src/test/java/com/hedera/hashgraph/identity/hcs/HcsIdentityNetworkTest.java
/**
   * Tests creation of a new identity network.
   *
   * @throws PrecheckStatusException In case a transaction fails precheck.
   * @throws ReceiptStatusException  In case a receipt contains an error.
   * @throws TimeoutException        In case the client fails to communicate with the network in a timely manner
   */
Tests creation of a new identity network.

@throws PrecheckStatusException In case a transaction fails precheck.
@throws ReceiptStatusException  In case a receipt contains an error.
@throws TimeoutException        In case the client fails to communicate with the network in a timely manner
Tests creation of a new identity network . @throws PrecheckStatusException In case a transaction fails precheck . @throws ReceiptStatusException In case a receipt contains an error . @throws TimeoutException In case the client fails to communicate with the network in a timely manner
@Test
  void testCreateIdentityNetwork() throws PrecheckStatusException, ReceiptStatusException, TimeoutException {
    final String appnetName = "Test Identity SDK appnet";
    final String didServerUrl = "http://localhost:3000/api/v1";
    final String didTopicMemo = "Test Identity SDK appnet DID topic";
    final String vcTopicMemo = "Test Identity SDK appnet VC topic";
    HcsIdentityNetwork didNetwork = new HcsIdentityNetworkBuilder()
            .setNetwork(network)
            .setAppnetName(appnetName)
            .addAppnetDidServer(didServerUrl)
            .setPublicKey(operatorKey.getPublicKey())
            .setMaxTransactionFee(FEE)
            .setDidTopicMemo(didTopicMemo)
            .setVCTopicMemo(vcTopicMemo)
            .execute(client);
    assertNotNull(didNetwork);
    assertNotNull(didNetwork.getAddressBook());
    AddressBook addressBook = didNetwork.getAddressBook();
    assertNotNull(addressBook.getDidTopicId());
    assertNotNull(addressBook.getVcTopicId());
    assertNotNull(addressBook.getAppnetDidServers());
    assertNotNull(addressBook.getFileId());
    assertEquals(addressBook.getAppnetName(), appnetName);
    assertEquals(didNetwork.getNetwork(), network);
    TopicInfo didTopicInfo = new TopicInfoQuery()
            .setTopicId(didNetwork.getDidTopicId())
            .execute(client);
    assertNotNull(didTopicInfo);
    assertEquals(didTopicInfo.topicMemo, didTopicMemo);
    TopicInfo vcTopicInfo = new TopicInfoQuery()
            .setTopicId(didNetwork.getVcTopicId())
            .execute(client);
    assertNotNull(vcTopicInfo);
    assertEquals(vcTopicInfo.topicMemo, vcTopicMemo);
    HcsIdentityNetwork createdNetwork = HcsIdentityNetwork.fromAddressBookFile(client, network,
            addressBook.getFileId());
    assertNotNull(createdNetwork);
    assertEquals(addressBook.toJson(), createdNetwork.getAddressBook().toJson());
  }
@ Test void testCreateIdentityNetwork ( ) throws PrecheckStatusException , ReceiptStatusException , TimeoutException { final String appnetName = "Test Identity SDK appnet" ; final String didServerUrl = "http://localhost:3000/api/v1" ; final String didTopicMemo = "Test Identity SDK appnet DID topic" ; final String vcTopicMemo = "Test Identity SDK appnet VC topic" ; HcsIdentityNetwork didNetwork = new HcsIdentityNetworkBuilder ( ) . setNetwork ( network ) . setAppnetName ( appnetName ) . addAppnetDidServer ( didServerUrl ) . setPublicKey ( operatorKey . getPublicKey ( ) ) . setMaxTransactionFee ( FEE ) . setDidTopicMemo ( didTopicMemo ) . setVCTopicMemo ( vcTopicMemo ) . execute ( client ) ; assertNotNull ( didNetwork ) ; assertNotNull ( didNetwork . getAddressBook ( ) ) ; AddressBook addressBook = didNetwork . getAddressBook ( ) ; assertNotNull ( addressBook . getDidTopicId ( ) ) ; assertNotNull ( addressBook . getVcTopicId ( ) ) ; assertNotNull ( addressBook . getAppnetDidServers ( ) ) ; assertNotNull ( addressBook . getFileId ( ) ) ; assertEquals ( addressBook . getAppnetName ( ) , appnetName ) ; assertEquals ( didNetwork . getNetwork ( ) , network ) ; TopicInfo didTopicInfo = new TopicInfoQuery ( ) . setTopicId ( didNetwork . getDidTopicId ( ) ) . execute ( client ) ; assertNotNull ( didTopicInfo ) ; assertEquals ( didTopicInfo . topicMemo , didTopicMemo ) ; TopicInfo vcTopicInfo = new TopicInfoQuery ( ) . setTopicId ( didNetwork . getVcTopicId ( ) ) . execute ( client ) ; assertNotNull ( vcTopicInfo ) ; assertEquals ( vcTopicInfo . topicMemo , vcTopicMemo ) ; HcsIdentityNetwork createdNetwork = HcsIdentityNetwork . fromAddressBookFile ( client , network , addressBook . getFileId ( ) ) ; assertNotNull ( createdNetwork ) ; assertEquals ( addressBook . toJson ( ) , createdNetwork . getAddressBook ( ) . toJson ( ) ) ; }
Tests creation of a new identity network.
Tests creation of a new identity network .
// Test if HCS topics exist.
 // DID topic
 // VC topic
 // Test if address book file was created
