@Test public void testGetAssetConfigValueByKeyAndTenantId() { final Map<String, List<String>> assetConfiguration = getAssetConfiguration(); final String expectedConfigValue = assetConfiguration .get(AssetConfigurationKeys.ENABLEVOUCHERGENERATION.toString()).get(0); when(assetConfigurationRepository.findForCriteria(any(AssetConfigurationCriteria.class))) .thenReturn(assetConfiguration); final String actualConfigValue = assetConfigurationService .getAssetConfigValueByKeyAndTenantId(AssetConfigurationKeys.ENABLEVOUCHERGENERATION, "ap.kurnool"); assertEquals(expectedConfigValue, actualConfigValue); }
public String getAssetConfigValueByKeyAndTenantId(final AssetConfigurationKeys assetConfigurationKey, final String tenantId) { final AssetConfigurationCriteria assetConfigurationCriteria = AssetConfigurationCriteria.builder() .name(assetConfigurationKey.toString()).tenantId(tenantId).build(); final Map<String, List<String>> assetConfiguration = assetConfigurationRepository .findForCriteria(assetConfigurationCriteria); if(assetConfiguration.isEmpty()) throw new RuntimeException("no asset configuration found for the key--"+assetConfigurationKey.toString() +" tenant value--"+tenantId); return assetConfiguration.get(assetConfigurationKey.toString()).get(0); }
AssetConfigurationService { public String getAssetConfigValueByKeyAndTenantId(final AssetConfigurationKeys assetConfigurationKey, final String tenantId) { final AssetConfigurationCriteria assetConfigurationCriteria = AssetConfigurationCriteria.builder() .name(assetConfigurationKey.toString()).tenantId(tenantId).build(); final Map<String, List<String>> assetConfiguration = assetConfigurationRepository .findForCriteria(assetConfigurationCriteria); if(assetConfiguration.isEmpty()) throw new RuntimeException("no asset configuration found for the key--"+assetConfigurationKey.toString() +" tenant value--"+tenantId); return assetConfiguration.get(assetConfigurationKey.toString()).get(0); } }
AssetConfigurationService { public String getAssetConfigValueByKeyAndTenantId(final AssetConfigurationKeys assetConfigurationKey, final String tenantId) { final AssetConfigurationCriteria assetConfigurationCriteria = AssetConfigurationCriteria.builder() .name(assetConfigurationKey.toString()).tenantId(tenantId).build(); final Map<String, List<String>> assetConfiguration = assetConfigurationRepository .findForCriteria(assetConfigurationCriteria); if(assetConfiguration.isEmpty()) throw new RuntimeException("no asset configuration found for the key--"+assetConfigurationKey.toString() +" tenant value--"+tenantId); return assetConfiguration.get(assetConfigurationKey.toString()).get(0); }  }
AssetConfigurationService { public String getAssetConfigValueByKeyAndTenantId(final AssetConfigurationKeys assetConfigurationKey, final String tenantId) { final AssetConfigurationCriteria assetConfigurationCriteria = AssetConfigurationCriteria.builder() .name(assetConfigurationKey.toString()).tenantId(tenantId).build(); final Map<String, List<String>> assetConfiguration = assetConfigurationRepository .findForCriteria(assetConfigurationCriteria); if(assetConfiguration.isEmpty()) throw new RuntimeException("no asset configuration found for the key--"+assetConfigurationKey.toString() +" tenant value--"+tenantId); return assetConfiguration.get(assetConfigurationKey.toString()).get(0); }  AssetConfigurationResponse search(final AssetConfigurationCriteria assetConfigurationCriteria); boolean getEnabledVoucherGeneration(final AssetConfigurationKeys assetConfigurationKey,
            final String tenantId); String getAssetConfigValueByKeyAndTenantId(final AssetConfigurationKeys assetConfigurationKey,
            final String tenantId); }
AssetConfigurationService { public String getAssetConfigValueByKeyAndTenantId(final AssetConfigurationKeys assetConfigurationKey, final String tenantId) { final AssetConfigurationCriteria assetConfigurationCriteria = AssetConfigurationCriteria.builder() .name(assetConfigurationKey.toString()).tenantId(tenantId).build(); final Map<String, List<String>> assetConfiguration = assetConfigurationRepository .findForCriteria(assetConfigurationCriteria); if(assetConfiguration.isEmpty()) throw new RuntimeException("no asset configuration found for the key--"+assetConfigurationKey.toString() +" tenant value--"+tenantId); return assetConfiguration.get(assetConfigurationKey.toString()).get(0); }  AssetConfigurationResponse search(final AssetConfigurationCriteria assetConfigurationCriteria); boolean getEnabledVoucherGeneration(final AssetConfigurationKeys assetConfigurationKey,
            final String tenantId); String getAssetConfigValueByKeyAndTenantId(final AssetConfigurationKeys assetConfigurationKey,
            final String tenantId);  }