@Test(expectedExceptions = GoodDataException.class) public void whenEmptyResponseThenUpdateProjectFeatureFlagShouldThrow() throws Exception { when(projectFeatureFlag.getUri()).thenReturn(PROJECT_FEATURE_FLAG_URI); when(restTemplate.getForObject(PROJECT_FEATURE_FLAG_URI, ProjectFeatureFlag.class)).thenReturn(null); service.updateProjectFeatureFlag(projectFeatureFlag); }
public ProjectFeatureFlag updateProjectFeatureFlag(final ProjectFeatureFlag flag) { notNull(flag, "flag"); notEmpty(flag.getUri(), "flag.uri"); try { restTemplate.put(flag.getUri(), flag); return getProjectFeatureFlag(flag.getUri()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to update project feature flag: " + flag, e); } }
FeatureFlagService extends AbstractService { public ProjectFeatureFlag updateProjectFeatureFlag(final ProjectFeatureFlag flag) { notNull(flag, "flag"); notEmpty(flag.getUri(), "flag.uri"); try { restTemplate.put(flag.getUri(), flag); return getProjectFeatureFlag(flag.getUri()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to update project feature flag: " + flag, e); } } }
FeatureFlagService extends AbstractService { public ProjectFeatureFlag updateProjectFeatureFlag(final ProjectFeatureFlag flag) { notNull(flag, "flag"); notEmpty(flag.getUri(), "flag.uri"); try { restTemplate.put(flag.getUri(), flag); return getProjectFeatureFlag(flag.getUri()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to update project feature flag: " + flag, e); } } FeatureFlagService(final RestTemplate restTemplate, final GoodDataSettings settings); }
FeatureFlagService extends AbstractService { public ProjectFeatureFlag updateProjectFeatureFlag(final ProjectFeatureFlag flag) { notNull(flag, "flag"); notEmpty(flag.getUri(), "flag.uri"); try { restTemplate.put(flag.getUri(), flag); return getProjectFeatureFlag(flag.getUri()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to update project feature flag: " + flag, 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 ProjectFeatureFlag updateProjectFeatureFlag(final ProjectFeatureFlag flag) { notNull(flag, "flag"); notEmpty(flag.getUri(), "flag.uri"); try { restTemplate.put(flag.getUri(), flag); return getProjectFeatureFlag(flag.getUri()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to update project feature flag: " + flag, 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; }