### Question:
AAIDataRetrieval { public List<VfModule> getVfModulesOfVnf(String vnfId) { List<VfModule> vfModuleList = new ArrayList<VfModule>(); AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModules()); Optional<VfModules> vfModules = getAaiResourcesClient().get(VfModules.class, uri); if (!vfModules.isPresent() || vfModules.get().getVfModule().isEmpty()) { logger.debug("No VfModules attached to Vnf in AAI : {}", vnfId); } else { vfModuleList = vfModules.get().getVfModule(); } return vfModuleList; }  ServiceInstance getServiceInstance(String serviceInstanceId); VfModule getAAIVfModule(String vnfId, String vfModuleId); GenericVnf getGenericVnf(String vnfId); VolumeGroup getVolumeGroup(String vnfId, String volumeGroupId); L3Network getNetwork(String networkId); boolean isVolumeGroupRelatedToVFModule(CloudConfiguration cloudConfig, String volumeGroupId); boolean isVnfRelatedToVolumes(String vnfId); boolean isNetworkRelatedToModules(String networkId); boolean isServiceRelatedToNetworks(String serviceInstanceId); boolean isServiceRelatedToGenericVnf(String serviceInstanceId); boolean isServiceRelatedToConfiguration(String serviceInstanceId); Service getService(String serviceId); Tenant getTenant(String cloudOwner, String cloudRegion, String tenantId); List<LInterface> getLinterfacesOfVnf(String vnfId); boolean isVnfRelatedToVFModule(String vnfId); List<VfModule> getVfModulesOfVnf(String vnfId); Optional<String> getVfModuleIdsByVnfId(String vnfId); List<VolumeGroup> getVolumeGroupsOfVnf(String vnfId); Optional<String> getVolumeGroupIdsByVnfId(String vnfId);  }### Answer:
@Test public void getVfModulesOfVnfTest() { VfModules vfModules = getVfModules(); AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("vnfId").vfModules()); doReturn(Optional.of(vfModules)).when(aaiResourcesClient).get(VfModules.class, uri); List<VfModule> vfModulesList = aaiDataRetrieval.getVfModulesOfVnf("vnfId"); assertEquals("vfm1", vfModulesList.get(0).getVfModuleId()); Optional<String> vfModuleIds = aaiDataRetrieval.getVfModuleIdsByVnfId("vnfId"); assertEquals(Optional.of("vfm1,vfm2"), vfModuleIds); }