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