use of org.sonar.server.ws.TestResponse in project sonarqube by SonarSource.
the class AddActionTest method http_no_content.
@Test
public void http_no_content() {
TestResponse result = call(request);
assertThat(result.getStatus()).isEqualTo(HTTP_NO_CONTENT);
}
use of org.sonar.server.ws.TestResponse in project sonarqube by SonarSource.
the class EnableSupportActionTest method call.
private void call() {
TestResponse response = tester.newRequest().setMethod("POST").execute();
assertThat(response.getStatus()).isEqualTo(HttpURLConnection.HTTP_NO_CONTENT);
}
use of org.sonar.server.ws.TestResponse in project sonarqube by SonarSource.
the class RemoveActionTest method http_no_content.
@Test
public void http_no_content() {
notificationUpdater.add(dbSession, defaultChannel.getKey(), NOTIF_MY_NEW_ISSUES, null);
dbSession.commit();
TestResponse result = call(request);
assertThat(result.getStatus()).isEqualTo(HTTP_NO_CONTENT);
}
use of org.sonar.server.ws.TestResponse in project sonarqube by SonarSource.
the class DeleteTemplateActionTest method delete_template_in_db.
@Test
public void delete_template_in_db() throws Exception {
runOnAllUnderTests((underTest) -> {
OrganizationDto organization = db.organizations().insert();
PermissionTemplateDto template = insertTemplateAndAssociatedPermissions(organization);
db.organizations().setDefaultTemplates(db.permissionTemplates().insertTemplate(organization), db.permissionTemplates().insertTemplate(organization));
loginAsAdmin(organization);
TestResponse result = newRequestByUuid(underTest, template.getUuid());
assertThat(result.getInput()).isEmpty();
assertTemplateDoesNotExist(template);
});
}
use of org.sonar.server.ws.TestResponse in project sonarqube by SonarSource.
the class LogsActionTest method get_es_logs.
@Test
public void get_es_logs() throws IOException {
logInAsSystemAdministrator();
createAllLogsFiles();
TestResponse response = actionTester.newRequest().setParam("process", "es").execute();
assertThat(response.getMediaType()).isEqualTo(MediaTypes.TXT);
assertThat(response.getInput()).isEqualTo("{es}");
}
Aggregations