### Question:
AAIServiceInstanceResources { public void createOwningEntityandConnectServiceInstance(OwningEntity owningEntity, ServiceInstance serviceInstance) { AAIResourceUri owningEntityURI = AAIUriFactory .createResourceUri(AAIFluentTypeBuilder.business().owningEntity(owningEntity.getOwningEntityId())); AAIResourceUri serviceInstanceURI = AAIUriFactory .createResourceUri(Types.SERVICE_INSTANCE.getFragment(serviceInstance.getServiceInstanceId())); org.onap.aai.domain.yang.OwningEntity aaiOwningEntity = aaiObjectMapper.mapOwningEntity(owningEntity); injectionHelper.getAaiClient().createIfNotExists(owningEntityURI, Optional.of(aaiOwningEntity)) .connect(owningEntityURI, serviceInstanceURI); }  boolean existsServiceInstance(ServiceInstance serviceInstance); void createServiceInstance(ServiceInstance serviceInstance, Customer customer); void createServiceSubscription(Customer customer); void deleteServiceInstance(ServiceInstance serviceInstance); void createProject(Project project); void createProjectandConnectServiceInstance(Project project, ServiceInstance serviceInstance); void createOwningEntity(OwningEntity owningEntity); boolean existsOwningEntity(OwningEntity owningEntity); boolean existsOwningEntityName(String owningEntityName); org.onap.aai.domain.yang.OwningEntity getOwningEntityByName(String owningEntityName); void connectOwningEntityandServiceInstance(OwningEntity owningEntity, ServiceInstance serviceInstance); void createOwningEntityandConnectServiceInstance(OwningEntity owningEntity,
            ServiceInstance serviceInstance); void updateOrchestrationStatusServiceInstance(ServiceInstance serviceInstance,
            OrchestrationStatus orchestrationStatus); void updateServiceInstance(ServiceInstance serviceInstance); boolean checkInstanceServiceNameInUse(ServiceInstance serviceInstance);  }### Answer:
@Test public void createOwningEntityandConnectServiceInstanceTest() { doReturn(MOCK_aaiResourcesClient).when(MOCK_aaiResourcesClient).createIfNotExists(any(AAIResourceUri.class), any(Optional.class)); doNothing().when(MOCK_aaiResourcesClient).connect(any(AAIResourceUri.class), any(AAIResourceUri.class)); doReturn(new org.onap.aai.domain.yang.OwningEntity()).when(MOCK_aaiObjectMapper).mapOwningEntity(owningEntity); aaiServiceInstanceResources.createOwningEntityandConnectServiceInstance(owningEntity, serviceInstance); verify(MOCK_aaiResourcesClient, times(1)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class)); verify(MOCK_aaiResourcesClient, times(1)).connect(any(AAIResourceUri.class), any(AAIResourceUri.class)); }