### Question:
AAIVnfResources { public void createVnfandConnectServiceInstance(GenericVnf vnf, ServiceInstance serviceInstance) { AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnf.getVnfId())); vnf.setOrchestrationStatus(OrchestrationStatus.INVENTORIED); AAIResourceUri serviceInstanceURI = AAIUriFactory .createResourceUri(Types.SERVICE_INSTANCE.getFragment(serviceInstance.getServiceInstanceId())); injectionHelper.getAaiClient().createIfNotExists(vnfURI, Optional.of(aaiObjectMapper.mapVnf(vnf))) .connect(vnfURI, serviceInstanceURI); }  void createVnfandConnectServiceInstance(GenericVnf vnf, ServiceInstance serviceInstance); void createPlatformandConnectVnf(Platform platform, GenericVnf vnf); void createLineOfBusinessandConnectVnf(LineOfBusiness lineOfBusiness, GenericVnf vnf); void deleteVnf(GenericVnf vnf); void updateOrchestrationStatusVnf(GenericVnf vnf, OrchestrationStatus orchestrationStatus); void updateObjectVnf(GenericVnf vnf); Optional<org.onap.aai.domain.yang.GenericVnf> getGenericVnf(String vnfId); boolean checkInMaintFlag(String vnfId); void connectVnfToCloudRegion(GenericVnf vnf, CloudRegion cloudRegion); void connectVnfToTenant(GenericVnf vnf, CloudRegion cloudRegion); boolean checkVnfClosedLoopDisabledFlag(String vnfId); boolean checkVnfPserversLockedFlag(String vnfId); boolean checkNameInUse(String vnfName); AAIResultWrapper queryVnfWrapperById(GenericVnf vnf); Optional<Vserver> getVserver(AAIResourceUri uri);  }### Answer:
@Test public void createVnfandConnectServiceInstanceTest() { doReturn(new org.onap.aai.domain.yang.GenericVnf()).when(MOCK_aaiObjectMapper).mapVnf(genericVnf); doReturn(MOCK_aaiResourcesClient).when(MOCK_aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class), any(Optional.class)); doNothing().when(MOCK_aaiResourcesClient).connect(any(AAIResourceUri.class), any(AAIResourceUri.class)); genericVnf.setOrchestrationStatus(OrchestrationStatus.PRECREATED); aaiVnfResources.createVnfandConnectServiceInstance(genericVnf, serviceInstance); assertEquals(OrchestrationStatus.INVENTORIED, genericVnf.getOrchestrationStatus()); verify(MOCK_aaiObjectMapper, times(1)).mapVnf(genericVnf); verify(MOCK_aaiResourcesClient, times(1)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class)); verify(MOCK_aaiResourcesClient, times(1)).connect(any(AAIResourceUri.class), any(AAIResourceUri.class)); }