### Question:
AAIVolumeGroupResources { public boolean checkNameInUse(VolumeGroup volumeGroup) { AAIPluralResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(Types.VOLUME_GROUPS.getFragment()) .queryParam("volume-group-name", volumeGroup.getVolumeGroupName()); return injectionHelper.getAaiClient().exists(volumeGroupUri); }  void createVolumeGroup(VolumeGroup volumeGroup, CloudRegion cloudRegion); void updateOrchestrationStatusVolumeGroup(VolumeGroup volumeGroup, CloudRegion cloudRegion,
            OrchestrationStatus orchestrationStatus); void connectVolumeGroupToVnf(GenericVnf genericVnf, VolumeGroup volumeGroup, CloudRegion cloudRegion); void connectVolumeGroupToTenant(VolumeGroup volumeGroup, CloudRegion cloudRegion); void deleteVolumeGroup(VolumeGroup volumeGroup, CloudRegion cloudRegion); void updateHeatStackIdVolumeGroup(VolumeGroup volumeGroup, CloudRegion cloudRegion); boolean checkNameInUse(VolumeGroup volumeGroup);  }### Answer:
@Test public void checkNameInUseTrueTest() { AAIPluralResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(Types.VOLUME_GROUPS.getFragment()) .queryParam("volume-group-name", "testVolumeGroupName1"); doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(volumeGroupUri)); boolean nameInUse = aaiVolumeGroupResources.checkNameInUse(volumeGroup); assertTrue(nameInUse); }
@Test public void checkNameInUseFalseTest() { AAIPluralResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(Types.VOLUME_GROUPS.getFragment()) .queryParam("volume-group-name", "testVolumeGroupName1"); doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(volumeGroupUri)); boolean nameInUse = aaiVolumeGroupResources.checkNameInUse(volumeGroup); assertFalse(nameInUse); }