private DefaultOrganizationProvider defaultOrganizationProvider = TestDefaultOrganizationProvider.from(db);
private DbClient dbClient = db.getDbClient();
- private WsActionTester underTest = new WsActionTester(new GhostsAction(dbClient, userSessionRule, defaultOrganizationProvider));
+
+ private WsActionTester ws = new WsActionTester(new GhostsAction(dbClient, userSessionRule, defaultOrganizationProvider));
@Test
- public void verify_definition() {
- WebService.Action action = underTest.getDef();
- assertThat(action.description()).isEqualTo("List ghost projects.<br /> Requires 'Administer System' permission.");
+ public void definition() {
+ WebService.Action action = ws.getDef();
+ assertThat(action.key()).isEqualTo("ghosts");
+ assertThat(action.description()).isEqualTo("List ghost projects.<br> " +
+ "With the current architecture, it's no more possible to have invisible ghost projects. Therefore, the web service is deprecated.<br> " +
+ "Requires 'Administer System' permission.");
assertThat(action.since()).isEqualTo("5.2");
assertThat(action.isInternal()).isFalse();
+ assertThat(action.deprecatedSince()).isEqualTo("6.6");
assertThat(action.params()).hasSize(5);
ComponentDto activeProject = insertActiveProject(organization);
userSessionRule.logIn().addPermission(ADMINISTER, organization);
- TestResponse result = underTest.newRequest()
+ TestResponse result = ws.newRequest()
.setParam("organization", organization.getKey())
.execute();
}
userSessionRule.logIn().addPermission(ADMINISTER, organization);
- TestResponse result = underTest.newRequest()
+ TestResponse result = ws.newRequest()
.setParam("organization", organization.getKey())
.setParam(Param.PAGE, "3")
.setParam(Param.PAGE_SIZE, "4")
insertGhostProject(organization);
userSessionRule.logIn().addPermission(ADMINISTER, organization);
- TestResponse result = underTest.newRequest()
+ TestResponse result = ws.newRequest()
.setParam("organization", organization.getKey())
.setParam(Param.FIELDS, "name")
.execute();
userSessionRule.logIn().addPermission(ADMINISTER, organization);
- TestResponse result = underTest.newRequest()
+ TestResponse result = ws.newRequest()
.setParam("organization", organization.getKey())
.setParam(Param.TEXT_QUERY, "name-1")
.execute();
userSessionRule.logIn().addPermission(ADMINISTER, organization);
- TestResponse result = underTest.newRequest()
+ TestResponse result = ws.newRequest()
.setParam("organization", organization.getKey())
.setParam(Param.TEXT_QUERY, "GHOST-key")
.execute();
db.getSession().commit();
userSessionRule.logIn().addPermission(ADMINISTER, organization);
- TestResponse result = underTest.newRequest()
+ TestResponse result = ws.newRequest()
.setParam("organization", organization.getKey())
.execute();
expectedException.expect(ForbiddenException.class);
expectedException.expectMessage("Insufficient privileges");
- underTest.newRequest().execute();
+ ws.newRequest().execute();
}
@Test
expectedException.expect(NotFoundException.class);
expectedException.expectMessage("No organization for key 'foo'");
- underTest.newRequest().setParam("organization", "foo").execute();
+ ws.newRequest().setParam("organization", "foo").execute();
}
private ComponentDto insertGhostProject(OrganizationDto organization) {