add tests for the security layer

This commit is contained in:
Athou
2023-12-16 19:55:34 +01:00
parent cb4a8df0d2
commit 351701d674
8 changed files with 156 additions and 126 deletions

View File

@@ -4,7 +4,6 @@ import javax.ws.rs.client.Entity;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import org.eclipse.jetty.http.HttpStatus;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -16,17 +15,12 @@ class CustomCodeIT extends BaseIT {
@Test
void test() {
// get settings
Settings settings = null;
try (Response response = getClient().target(getApiBaseUrl() + "user/settings").request().get()) {
settings = response.readEntity(Settings.class);
}
Settings settings = getClient().target(getApiBaseUrl() + "user/settings").request().get(Settings.class);
// update settings
settings.setCustomJs("custom-js");
settings.setCustomCss("custom-css");
try (Response response = getClient().target(getApiBaseUrl() + "user/settings").request().post(Entity.json(settings))) {
Assertions.assertEquals(HttpStatus.OK_200, response.getStatus());
}
getClient().target(getApiBaseUrl() + "user/settings").request().post(Entity.json(settings), Void.TYPE);
// check custom code servlets
String cookie = login();

View File

@@ -14,7 +14,7 @@ class NextUnreadIT extends BaseIT {
@Test
void test() {
Long subscriptionId = subscribeAndWaitForEntries(getFeedUrl());
subscribeAndWaitForEntries(getFeedUrl());
String cookie = login();
Response response = getClient().target(getBaseUrl() + "next")