@Test(expectedExceptions = GoodDataException.class) public void whenEmptyResponseThenGetProjectFeatureFlagsShouldThrow() throws Exception { when(restTemplate.getForObject(new URI(PROJECT_FEATURE_FLAGS_URI), ProjectFeatureFlags.class)).thenReturn(null); service.listProjectFeatureFlags(project); }
public ProjectFeatureFlags listProjectFeatureFlags(final Project project) { notNull(project, "project"); try { final ProjectFeatureFlags projectFeatureFlags = restTemplate .getForObject(PROJECT_FEATURE_FLAGS_TEMPLATE.expand(project.getId()), ProjectFeatureFlags.class); if (projectFeatureFlags == null) { throw new GoodDataException("empty response from API call"); } return projectFeatureFlags; } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to list project feature flags for project ID=" + project.getId(), e); } }
FeatureFlagService extends AbstractService { public ProjectFeatureFlags listProjectFeatureFlags(final Project project) { notNull(project, "project"); try { final ProjectFeatureFlags projectFeatureFlags = restTemplate .getForObject(PROJECT_FEATURE_FLAGS_TEMPLATE.expand(project.getId()), ProjectFeatureFlags.class); if (projectFeatureFlags == null) { throw new GoodDataException("empty response from API call"); } return projectFeatureFlags; } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to list project feature flags for project ID=" + project.getId(), e); } } }
FeatureFlagService extends AbstractService { public ProjectFeatureFlags listProjectFeatureFlags(final Project project) { notNull(project, "project"); try { final ProjectFeatureFlags projectFeatureFlags = restTemplate .getForObject(PROJECT_FEATURE_FLAGS_TEMPLATE.expand(project.getId()), ProjectFeatureFlags.class); if (projectFeatureFlags == null) { throw new GoodDataException("empty response from API call"); } return projectFeatureFlags; } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to list project feature flags for project ID=" + project.getId(), e); } } FeatureFlagService(final RestTemplate restTemplate, final GoodDataSettings settings); }
FeatureFlagService extends AbstractService { public ProjectFeatureFlags listProjectFeatureFlags(final Project project) { notNull(project, "project"); try { final ProjectFeatureFlags projectFeatureFlags = restTemplate .getForObject(PROJECT_FEATURE_FLAGS_TEMPLATE.expand(project.getId()), ProjectFeatureFlags.class); if (projectFeatureFlags == null) { throw new GoodDataException("empty response from API call"); } return projectFeatureFlags; } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to list project feature flags for project ID=" + project.getId(), e); } } FeatureFlagService(final RestTemplate restTemplate, final GoodDataSettings settings); FeatureFlags listFeatureFlags(final Project project); ProjectFeatureFlags listProjectFeatureFlags(final Project project); ProjectFeatureFlag getProjectFeatureFlag(final Project project, final String featureFlagName); ProjectFeatureFlag createProjectFeatureFlag(final Project project, final ProjectFeatureFlag flag); ProjectFeatureFlag updateProjectFeatureFlag(final ProjectFeatureFlag flag); void deleteProjectFeatureFlag(final ProjectFeatureFlag flag); }
FeatureFlagService extends AbstractService { public ProjectFeatureFlags listProjectFeatureFlags(final Project project) { notNull(project, "project"); try { final ProjectFeatureFlags projectFeatureFlags = restTemplate .getForObject(PROJECT_FEATURE_FLAGS_TEMPLATE.expand(project.getId()), ProjectFeatureFlags.class); if (projectFeatureFlags == null) { throw new GoodDataException("empty response from API call"); } return projectFeatureFlags; } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to list project feature flags for project ID=" + project.getId(), e); } } FeatureFlagService(final RestTemplate restTemplate, final GoodDataSettings settings); FeatureFlags listFeatureFlags(final Project project); ProjectFeatureFlags listProjectFeatureFlags(final Project project); ProjectFeatureFlag getProjectFeatureFlag(final Project project, final String featureFlagName); ProjectFeatureFlag createProjectFeatureFlag(final Project project, final ProjectFeatureFlag flag); ProjectFeatureFlag updateProjectFeatureFlag(final ProjectFeatureFlag flag); void deleteProjectFeatureFlag(final ProjectFeatureFlag flag); static final UriTemplate PROJECT_FEATURE_FLAG_TEMPLATE; static final UriTemplate PROJECT_FEATURE_FLAGS_TEMPLATE; static final UriTemplate AGGREGATED_FEATURE_FLAGS_TEMPLATE; }