Skip to content

Commit

Permalink
fix broken tests (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
marwanehcine committed Mar 8, 2024
1 parent fc73b31 commit b683156
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class GeorchestraUserHeadersContributor extends HeaderContributor {
add(headers, SEC_LDAP_REMAINING_DAYS, Optional
.of(user.isPresent() && user.get().getLdapWarn() != null && user.get().getLdapWarn()),
user.map(GeorchestraUser::getLdapRemainingDays));
add(headers, SEC_EXTERNAL_AUTHENTICATION, Optional.of(true),
add(headers, SEC_EXTERNAL_AUTHENTICATION, Optional.of(user.isPresent()),
String.valueOf(user.isPresent() && user.get().getIsExternalAuth()));
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -88,10 +86,7 @@ void testNoUser() {

HttpHeaders target = new HttpHeaders();
contributor.accept(target);
assertFalse(target.isEmpty());
Objects.requireNonNull(target.get(SEC_EXTERNAL_AUTHENTICATION));
assertEquals(List.of("false"), target.get(SEC_EXTERNAL_AUTHENTICATION));
assertEquals(1, target.size());
assertTrue(target.isEmpty());
}

@Test
Expand Down

0 comments on commit b683156

Please sign in to comment.