@Test public void verify_definition() { WebService.Action action = wsTester.getDef(); assertThat(action.key()).isEqualTo("search"); assertThat(action.isInternal()).isTrue(); assertThat(action.isPost()).isFalse(); assertThat(action.since()).isEqualTo("6.2"); assertThat(action.description()).isEqualTo("Search for root users.<br/>" + "Requires to be root."); assertThat(action.responseExample()).isNotNull(); assertThat(action.deprecatedKey()).isNull(); assertThat(action.deprecatedSince()).isNull(); assertThat(action.handler()).isSameAs(underTest); assertThat(action.params()).isEmpty(); }
@Test public void verify_definition() { WebService.Action action = wsTester.getDef(); assertThat(action.key()).isEqualTo("set_root"); assertThat(action.isInternal()).isTrue(); assertThat(action.isPost()).isTrue(); assertThat(action.since()).isEqualTo("6.2"); assertThat(action.description()).isEqualTo("Make the specified user root.<br/>" + "Requires to be root."); assertThat(action.responseExample()).isNull(); assertThat(action.deprecatedKey()).isNull(); assertThat(action.deprecatedSince()).isNull(); assertThat(action.handler()).isSameAs(underTest); assertThat(action.params()).hasSize(1); WebService.Param param = action.param("login"); assertThat(param.isRequired()).isTrue(); assertThat(param.description()).isEqualTo("A user login"); assertThat(param.defaultValue()).isNull(); assertThat(param.deprecatedSince()).isNull(); assertThat(param.deprecatedKey()).isNull(); assertThat(param.exampleValue()).isEqualTo("admin"); }
@Test public void verify_definition() { WebService.Action action = wsTester.getDef(); assertThat(action.key()).isEqualTo("unset_root"); assertThat(action.isInternal()).isTrue(); assertThat(action.isPost()).isTrue(); assertThat(action.since()).isEqualTo("6.2"); assertThat(action.description()).isEqualTo("Make the specified user not root.<br/>" + "Requires to be root."); assertThat(action.responseExample()).isNull(); assertThat(action.deprecatedKey()).isNull(); assertThat(action.deprecatedSince()).isNull(); assertThat(action.handler()).isSameAs(underTest); assertThat(action.params()).hasSize(1); WebService.Param param = action.param("login"); assertThat(param.isRequired()).isTrue(); assertThat(param.description()).isEqualTo("A user login"); assertThat(param.defaultValue()).isNull(); assertThat(param.deprecatedSince()).isNull(); assertThat(param.deprecatedKey()).isNull(); assertThat(param.exampleValue()).isEqualTo("admin"); }