### Question:
AAIVnfResources { public boolean checkNameInUse(String vnfName) { AAIPluralResourceUri vnfUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnfs()) .queryParam("vnf-name", vnfName); return injectionHelper.getAaiClient().exists(vnfUri); }  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 checkNameInUseTrueTest() { AAIPluralResourceUri vnfUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnfs()) .queryParam("vnf-name", "vnfName"); doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(vnfUri)); boolean nameInUse = aaiVnfResources.checkNameInUse("vnfName"); assertTrue(nameInUse); }
@Test public void checkNameInUseFalseTest() { AAIPluralResourceUri vnfUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnfs()) .queryParam("vnf-name", "vnfName"); doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(vnfUri)); boolean nameInUse = aaiVnfResources.checkNameInUse("vnfName"); assertFalse(nameInUse); }