CloudAppController implements RestfulController { @Mapping(method = Http.PUT) public boolean update(@RequestBody final CloudAppConfigurationPOJO appConfig) { appConfigService.update(appConfig); return true; } CloudAppController(); static void init(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager); @Mapping(method = Http.POST) boolean register(@RequestBody final CloudAppConfigurationPOJO appConfig); @Mapping(method = Http.PUT) boolean update(@RequestBody final CloudAppConfigurationPOJO appConfig); @Mapping(method = Http.GET, path = "/{appName}") CloudAppConfigurationPOJO detail(@Param(name = "appName", source = ParamSource.PATH) final String appName); @Mapping(method = Http.GET, path = "/list") Collection<CloudAppConfigurationPOJO> findAllApps(); @Mapping(method = Http.GET, path = "/{appName}/disable") boolean isDisabled(@Param(name = "appName", source = ParamSource.PATH) final String appName); @Mapping(method = Http.POST, path = "/{appName}/disable") boolean disable(@Param(name = "appName", source = ParamSource.PATH) final String appName); @Mapping(method = Http.POST, path = "/{appName}/enable") boolean enable(@Param(name = "appName", source = ParamSource.PATH) final String appName); @Mapping(method = Http.DELETE, path = "/{appName}") boolean deregister(@Param(name = "appName", source = ParamSource.PATH) final String appName);  }
@Test public void assertUpdate() { when(getRegCenter().isExisted("/config/app/test_app")).thenReturn(true); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); assertThat(HttpTestUtil.put("http: verify(getRegCenter()).update("/config/app/test_app", YAML); }