@Test(expectedExceptions = IllegalArgumentException.class) public void whenNullProjectThenCreateProjectFeatureFlagShouldThrow() throws Exception { service.createProjectFeatureFlag(null, projectFeatureFlag); }
public ProjectFeatureFlag createProjectFeatureFlag(final Project project, final ProjectFeatureFlag flag) { notNull(project, "project"); notNull(flag, "flag"); final String featureFlagsUri = PROJECT_FEATURE_FLAGS_TEMPLATE.expand(project.getId()).toString(); try { final URI featureFlagUri = restTemplate.postForLocation(featureFlagsUri, flag); if (featureFlagUri == null) { throw new GoodDataException("URI of new project feature flag can't be null"); } return getProjectFeatureFlag(featureFlagUri.toString()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to create project feature flag: " + flag, e); } }
FeatureFlagService extends AbstractService { public ProjectFeatureFlag createProjectFeatureFlag(final Project project, final ProjectFeatureFlag flag) { notNull(project, "project"); notNull(flag, "flag"); final String featureFlagsUri = PROJECT_FEATURE_FLAGS_TEMPLATE.expand(project.getId()).toString(); try { final URI featureFlagUri = restTemplate.postForLocation(featureFlagsUri, flag); if (featureFlagUri == null) { throw new GoodDataException("URI of new project feature flag can't be null"); } return getProjectFeatureFlag(featureFlagUri.toString()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to create project feature flag: " + flag, e); } } }
FeatureFlagService extends AbstractService { public ProjectFeatureFlag createProjectFeatureFlag(final Project project, final ProjectFeatureFlag flag) { notNull(project, "project"); notNull(flag, "flag"); final String featureFlagsUri = PROJECT_FEATURE_FLAGS_TEMPLATE.expand(project.getId()).toString(); try { final URI featureFlagUri = restTemplate.postForLocation(featureFlagsUri, flag); if (featureFlagUri == null) { throw new GoodDataException("URI of new project feature flag can't be null"); } return getProjectFeatureFlag(featureFlagUri.toString()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to create project feature flag: " + flag, e); } } FeatureFlagService(final RestTemplate restTemplate, final GoodDataSettings settings); }
FeatureFlagService extends AbstractService { public ProjectFeatureFlag createProjectFeatureFlag(final Project project, final ProjectFeatureFlag flag) { notNull(project, "project"); notNull(flag, "flag"); final String featureFlagsUri = PROJECT_FEATURE_FLAGS_TEMPLATE.expand(project.getId()).toString(); try { final URI featureFlagUri = restTemplate.postForLocation(featureFlagsUri, flag); if (featureFlagUri == null) { throw new GoodDataException("URI of new project feature flag can't be null"); } return getProjectFeatureFlag(featureFlagUri.toString()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to create 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 createProjectFeatureFlag(final Project project, final ProjectFeatureFlag flag) { notNull(project, "project"); notNull(flag, "flag"); final String featureFlagsUri = PROJECT_FEATURE_FLAGS_TEMPLATE.expand(project.getId()).toString(); try { final URI featureFlagUri = restTemplate.postForLocation(featureFlagsUri, flag); if (featureFlagUri == null) { throw new GoodDataException("URI of new project feature flag can't be null"); } return getProjectFeatureFlag(featureFlagUri.toString()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to create 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; }