use of org.hyperledger.fabric.sdk.NetworkConfig.CAInfo in project fabric-sdk-java by hyperledger.
the class NetworkConfigIT method doMainSetup.
@BeforeClass
public static void doMainSetup() throws Exception {
out("\n\n\nRUNNING: NetworkConfigIT.\n");
resetConfig();
configHelper.customizeConfig();
// Use the appropriate TLS/non-TLS network config file
networkConfig = NetworkConfig.fromYamlFile(testConfig.getTestNetworkConfigFileYAML());
// Check if we get access to defined CAs!
CAInfo caInfo = networkConfig.getOrganizationInfo("Org1").getCertificateAuthorities().get(0);
HFCAClient hfcaClient = HFCAClient.createNewInstance(caInfo);
assertEquals(hfcaClient.getCAName(), caInfo.getCAName());
// makes actual REST call.
HFCAInfo info = hfcaClient.info();
assertEquals(caInfo.getCAName(), info.getCAName());
// with no caname or the default
caInfo = networkConfig.getOrganizationInfo("Org2").getCertificateAuthorities().get(0);
hfcaClient = HFCAClient.createNewInstance(caInfo);
assertEquals(hfcaClient.getCAName(), caInfo.getCAName());
assertNull(caInfo.getCAName());
// makes actual REST call.
info = hfcaClient.info();
// means default
assertEquals(info.getCAName(), "");
// Ensure the chaincode required for these tests is deployed
deployChaincodeIfRequired();
}
Aggregations