Skip to content

Commit

Permalink
adding an IT for testing login via email instead of uid
Browse files Browse the repository at this point in the history
Should have been done in the context of PR #50, but better late than
never.
  • Loading branch information
pmauduit committed Mar 14, 2024
1 parent 985a028 commit fcec37a
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ static void registerLdap(DynamicPropertyRegistry registry) {
.jsonPath("$.GeorchestraUser.username").isEqualTo("testadmin");
}

public @Test void testWhoamiUsingEmail() {
testClient.get().uri("/whoami")//
.header("Authorization", "Basic cHNjK3Rlc3RhZG1pbkBnZW9yY2hlc3RyYS5vcmc6dGVzdGFkbWlu") // [email protected]:testadmin
.exchange()//
.expectStatus()//
.is2xxSuccessful()//
.expectBody()//
.jsonPath("$.GeorchestraUser.username").isEqualTo("testadmin");
}

public @Test void testWhoamiNoPasswordRevealed() {
testClient.get().uri("/whoami")//
.header("Authorization", "Basic dGVzdGFkbWluOnRlc3RhZG1pbg==") // testadmin:testadmin
Expand Down

0 comments on commit fcec37a

Please sign in to comment.