### Question:
AAIPnfResources { public void createPnfAndConnectServiceInstance(Pnf pnf, ServiceInstance serviceInstance) { AAIResourceUri pnfURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().pnf(pnf.getPnfName())); pnf.setOrchestrationStatus(OrchestrationStatus.INVENTORIED); AAIResourceUri serviceInstanceURI = AAIUriFactory .createResourceUri(Types.SERVICE_INSTANCE.getFragment(serviceInstance.getServiceInstanceId())); injectionHelper.getAaiClient().createIfNotExists(pnfURI, Optional.of(aaiObjectMapper.mapPnf(pnf))) .connect(pnfURI, serviceInstanceURI); }  void createPnfAndConnectServiceInstance(Pnf pnf, ServiceInstance serviceInstance); void updateOrchestrationStatusPnf(Pnf pnf, OrchestrationStatus orchestrationStatus); void checkIfPnfExistsInAaiAndCanBeUsed(Pnf pnf);  }### Answer:
@Test public void createPnfAndConnectServiceInstanceShouldSetInventoriedStatusAndCallConnectMethod() { org.onap.aai.domain.yang.Pnf pnfYang = new org.onap.aai.domain.yang.Pnf(); doReturn(pnfYang).when(aaiObjectMapperMock).mapPnf(pnf); doReturn(aaiResourcesClientMock).when(aaiResourcesClientMock).createIfNotExists(any(AAIResourceUri.class), eq(Optional.of(pnfYang))); testedObject.createPnfAndConnectServiceInstance(pnf, serviceInstance); assertEquals(OrchestrationStatus.INVENTORIED, pnf.getOrchestrationStatus()); verify(aaiResourcesClientMock, times(1)).connect(any(AAIResourceUri.class), any(AAIResourceUri.class)); }