### Question:
AAINetworkResources { public void createNetworkConnectToServiceInstance(L3Network network, ServiceInstance serviceInstance) { AAIResourceUri networkURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().l3Network(network.getNetworkId())); network.setOrchestrationStatus(OrchestrationStatus.INVENTORIED); AAIResourceUri serviceInstanceURI = AAIUriFactory .createResourceUri(Types.SERVICE_INSTANCE.getFragment(serviceInstance.getServiceInstanceId())); org.onap.aai.domain.yang.L3Network aaiL3Network = aaiObjectMapper.mapNetwork(network); injectionHelper.getAaiClient().createIfNotExists(networkURI, Optional.of(aaiL3Network)).connect(networkURI, serviceInstanceURI); }  void updateNetwork(L3Network network); void updateSubnet(L3Network network, Subnet subnet); void createNetworkConnectToServiceInstance(L3Network network, ServiceInstance serviceInstance); void createLineOfBusinessAndConnectNetwork(LineOfBusiness lineOfBusiness, L3Network network); void createPlatformAndConnectNetwork(Platform platform, L3Network network); void deleteNetwork(L3Network network); Optional<VpnBinding> getVpnBinding(AAIResourceUri netBindingUri); Optional<NetworkPolicy> getNetworkPolicy(AAIBaseResourceUri netPolicyUri); Optional<NetworkPolicies> getNetworkPolicies(AAIBaseResourceUri netPoliciesUri); Optional<org.onap.aai.domain.yang.Subnet> getSubnet(AAIResourceUri subnetUri); Optional<RouteTableReference> getRouteTable(AAIResourceUri rTableUri); Optional<org.onap.aai.domain.yang.L3Network> queryNetworkById(L3Network l3network); AAIResultWrapper queryNetworkWrapperById(L3Network l3network); void createNetworkInstanceGroup(InstanceGroup instanceGroup); void createNetworkCollection(Collection networkCollection); void connectNetworkToTenant(L3Network l3network, CloudRegion cloudRegion); void connectNetworkToCloudRegion(L3Network l3network, CloudRegion cloudRegion); void connectNetworkToNetworkCollectionInstanceGroup(L3Network l3network, InstanceGroup instanceGroup); void connectNetworkToNetworkCollectionServiceInstance(L3Network l3network,
            ServiceInstance networkCollectionServiceInstance); void connectNetworkCollectionInstanceGroupToNetworkCollection(InstanceGroup instanceGroup,
            Collection networkCollection); void connectInstanceGroupToCloudRegion(InstanceGroup instanceGroup, CloudRegion cloudRegion); void connectNetworkCollectionToServiceInstance(Collection networkCollection,
            ServiceInstance networkCollectionServiceInstance); void deleteCollection(Collection collection); void deleteNetworkInstanceGroup(InstanceGroup instanceGroup); void createNetworkPolicy(org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy networkPolicy); void deleteNetworkPolicy(String networkPolicyId); boolean checkNetworkNameInUse(String networkName);  }### Answer:
@Test public void createNetworkConnectToServiceInstanceTest() throws Exception { network.setOrchestrationStatus(OrchestrationStatus.PRECREATED); doReturn(new org.onap.aai.domain.yang.L3Network()).when(MOCK_aaiObjectMapper).mapNetwork(network); doReturn(MOCK_aaiResourcesClient).when(MOCK_aaiResourcesClient).createIfNotExists(any(AAIResourceUri.class), any(Optional.class)); doNothing().when(MOCK_aaiResourcesClient).connect(isA(AAIResourceUri.class), any(AAIResourceUri.class)); aaiNetworkResources.createNetworkConnectToServiceInstance(network, serviceInstance); assertEquals(OrchestrationStatus.INVENTORIED, network.getOrchestrationStatus()); verify(MOCK_aaiResourcesClient, times(1)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class)); verify(MOCK_aaiResourcesClient, times(1)).connect(any(AAIResourceUri.class), any(AAIResourceUri.class)); }