diff --git a/.github/workflows/fabric_integration_tests.yml b/.github/workflows/fabric_integration_tests.yml new file mode 100644 index 00000000..0cbcabc9 --- /dev/null +++ b/.github/workflows/fabric_integration_tests.yml @@ -0,0 +1,21 @@ +name: Fabric Integration Tests + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Clone the repository + uses: "actions/checkout@v2" + - name: Setup JDK 8 + uses: "actions/setup-java@v2" + with: + java-version: '8' + distribution: 'adopt-openj9' + - name: Run integration tests + run: | + chmod +x ./scripts/run-integration-tests.sh + ./scripts/run-integration-tests.sh \ No newline at end of file diff --git a/.gitignore b/.gitignore index 45feb7d3..e53391d5 100644 --- a/.gitignore +++ b/.gitignore @@ -76,7 +76,6 @@ target/ *.iml #env -.env /config/application.yml application.yml /config/connection-* diff --git a/src/test/java/fabricSetup/.env b/src/test/java/fabricSetup/.env new file mode 100644 index 00000000..12126fbf --- /dev/null +++ b/src/test/java/fabricSetup/.env @@ -0,0 +1,16 @@ +#default env. vars settings +#TLS: +#ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=true +#ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS=--tls.enabled +ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=false +ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS= +ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CLIENT_AUTH_REQUIRED=false +# +#Image tags - Fabric versions. + +##V 2.1 +FAB_CONFIG_GEN_VERS=v2.1 +V11_IDENTITIES_ALLOWREMOVE=--cfg.identities.allowremove +V11_AFFILIATIONS_ALLOWREMOVE=--cfg.affiliations.allowremove +IMAGE_TAG_FABRIC=:2.1 +IMAGE_TAG_FABRIC_CA=:1.4 diff --git a/src/test/java/hlf/java/rest/client/IT/ChannelIT.java b/src/test/java/hlf/java/rest/client/IT/ChannelIT.java index 23bd6678..9ff4bf25 100644 --- a/src/test/java/hlf/java/rest/client/IT/ChannelIT.java +++ b/src/test/java/hlf/java/rest/client/IT/ChannelIT.java @@ -24,7 +24,7 @@ public class ChannelIT { @Autowired ChannelService channelService; - private static final String CHANNEL_NAME = "test2"; + private static final String CHANNEL_NAME = "test1"; private static final String ORG_MSP = "Org1MSP"; @Test diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index bd0807c1..ef2e07eb 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -29,7 +29,7 @@ fabric: name: clientUser orgConnectionConfig: path: "src/test/resources/testconfig" - filename: connection.yml + filename: fabric-connection.yml client: rest: apikey: ePVYHwAaQ0V1XOTX6U diff --git a/src/test/resources/testconfig/fabric-connection.yml b/src/test/resources/testconfig/fabric-connection.yml new file mode 100644 index 00000000..5a5d9a79 --- /dev/null +++ b/src/test/resources/testconfig/fabric-connection.yml @@ -0,0 +1,29 @@ +name: fabric-network +version: 1.0.0 +client: + organization: Org1 + connection: + timeout: + peer: + endorser: '300' +organizations: + Org1: + mspid: Org1MSP + peers: + - peer0.org1.example.com + certificateAuthorities: + - ca-org1 +peers: + peer0.org1.example.com: + url: grpc://localhost:7051 + tlsCACerts: + path: src/test/java/fabricSetup/e2e-2Orgs/v2.1/crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem + +certificateAuthorities: + ca-org1: + url: https://localhost:7054 + caName: ca0 + tlsCACerts: + path: src/test/java/fabricSetup/e2e-2Orgs/v2.1/crypto-config/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem + httpOptions: + verify: true