do not require CAS service ticket for tests

This commit is contained in:
Michael Hoennig 2024-12-18 17:20:33 +01:00
parent 2ec44f1a43
commit 2338c3cc57
3 changed files with 2 additions and 3 deletions

View File

@ -25,7 +25,7 @@ public class CasAuthenticationFilter implements Filter {
final var ticket = httpRequest.getHeader("Authorization");
if (ticket == null || !ticketValidator.validateTicket(ticket)) {
if (!ticketValidator.validateTicket(ticket)) {
httpResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return;
}

View File

@ -22,7 +22,7 @@ public class CasServiceTicketValidator {
@SneakyThrows
public boolean validateTicket(final String ticket) {
if (casServerUrl.equals("fake") && ticket.equals("test")) {
if (casServerUrl.equals("fake")) {
return true;
}

View File

@ -207,7 +207,6 @@ public abstract class UseCase<T extends UseCase<?>> {
.uri(new URI("http://localhost:" + testSuite.port + uriPath))
.header("Content-Type", "application/json")
.header("current-subject", ScenarioTest.RUN_AS_USER)
.header("Authorization", "test")
.timeout(seconds(10))
.build();
final var response = client.send(request, BodyHandlers.ofString());