GlobalConfigResourceImpl implements GlobalConfigResource { @Timed @Override public ConfigProperty create(final ConfigProperty configProperty) { RestUtil.requireNonNull(configProperty, "configProperty not supplied"); RestUtil.requireNonNull(configProperty.getName(), "configProperty name cannot be null"); try { return globalConfigService.update(configProperty); } catch (ConfigPropertyValidationException e) { throw new BadRequestException(e.getMessage(), e); } } @Inject  GlobalConfigResourceImpl(final GlobalConfigService globalConfigService,
                             final NodeService nodeService,
                             final UiConfig uiConfig,
                             final NodeInfo nodeInfo,
                             final WebTargetFactory webTargetFactory,
                             final UriFactory uriFactory); @Timed @Override ListConfigResponse list(final GlobalConfigCriteria criteria); @Timed @Override ListConfigResponse listByNode(final String nodeName,
                                         final GlobalConfigCriteria criteria); @Timed @Override ConfigProperty getPropertyByName(final String propertyPath); @Timed OverrideValue<String> getYamlValueByName(final String propertyPath); @Timed @Override OverrideValue<String> getYamlValueByNodeAndName(final String propertyName,
                                                           final String nodeName); @Timed @Override ConfigProperty create(final ConfigProperty configProperty); @Timed @Override ConfigProperty update(final String propertyName, final ConfigProperty configProperty); @Timed @Override UiConfig fetchUiConfig();  }
@Test void create() { initNodes(); final String subPath = ""; ConfigProperty newConfigProperty = new ConfigProperty(PropertyPath.fromPathString("a.new.config.prop")); ConfigProperty expectedConfigProperty = new ConfigProperty(PropertyPath.fromPathString("a.new.config.prop")); expectedConfigProperty.setId(1); expectedConfigProperty.setVersion(1); final ConfigProperty createdConfigProperty = doPostTest( subPath, newConfigProperty, ConfigProperty.class, expectedConfigProperty); }