Skip to content

Commit

Permalink
Update Keycloak Dependency to 25.0.6 (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
robson90 authored Nov 4, 2024
1 parent 4474bd3 commit 87a5af3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ void executeBrowserFlow(String userName, String password, String requiredAction)
Assertions.fail();
}

page.waitForURL(String.format("%s/realms/required-action/account/#/security/signingin", keycloak.getAuthServerUrl()));
page.waitForURL(String.format("%s/realms/required-action/account/", keycloak.getAuthServerUrl()));

assertThat(page.getByRole(AriaRole.HEADING, new Page.GetByRoleOptions().setName("Signing in")).first()).isVisible();
assertThat(page.getByRole(AriaRole.HEADING, new Page.GetByRoleOptions().setName("Personal info")).first()).isVisible();

browser.close();
}
Expand Down Expand Up @@ -189,7 +189,6 @@ void testThatErrorIsLoggedWhenAuthenticatorConfigReferencesNonExistentRequiredAc
private void loginUser(Browser browser, Page page, String username, String password) {
page.navigate(String.format("%s/realms/required-action/account/", keycloak.getAuthServerUrl()));

page.getByText("Signing in").click();
page.waitForURL("**/realms/required-action/protocol/openid-connect/auth**");

// Login Page
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
package de.conciso.keycloak.resource;

import de.conciso.keycloak.resource.admin.GetUsersByIdResource;
import jakarta.ws.rs.ForbiddenException;
import jakarta.ws.rs.core.Response;
import java.util.List;
import java.util.UUID;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.keycloak.common.Profile;
import org.keycloak.models.KeycloakContext;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.RealmModel;
import org.keycloak.models.UserModel;
import org.keycloak.models.UserProvider;
import org.keycloak.models.*;
import org.keycloak.models.light.LightweightUserAdapter;
import org.keycloak.representations.idm.UserRepresentation;
import org.keycloak.services.ForbiddenException;
import org.keycloak.services.resources.admin.permissions.AdminPermissionEvaluator;
import org.keycloak.services.resources.admin.permissions.UserPermissionEvaluator;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockedStatic;
import org.mockito.Mockito;
import org.mockito.Spy;
import org.mockito.junit.jupiter.MockitoExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.UUID;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.BDDMockito.given;
Expand Down Expand Up @@ -144,8 +139,8 @@ void thenReturnsCorrectUser() {
var userRepresentations = (List<UserRepresentation>) response.getEntity();

assertThat(userRepresentations)
.extracting(UserRepresentation::getEmail)
.containsExactly("[email protected]");
.extracting(UserRepresentation::getEmail)
.containsExactly("[email protected]");
}
}
}
Expand Down Expand Up @@ -185,8 +180,8 @@ void setUp() {
void thenReturns404() {
assertThat(response.getStatus()).isEqualTo(404);
assertThat((String) response.getEntity())
.contains(NOT_KNOWN_ID.toString())
.contains("could not be Found");
.contains(NOT_KNOWN_ID.toString())
.contains("could not be Found");

}
}
Expand Down Expand Up @@ -217,8 +212,8 @@ void setUp() {
void thenReturns404() {
assertThat(response.getStatus()).isEqualTo(404);
assertThat((String) response.getEntity())
.contains(NOT_KNOWN_ID.toString())
.contains("could not be Found");
.contains(NOT_KNOWN_ID.toString())
.contains("could not be Found");

}
}
Expand All @@ -242,9 +237,9 @@ class WhenGetAllUsersById {
@Test
void thenReturnsForbidden() {
assertThatThrownBy(() ->
cut.getAllUsersByListOfIds(listWithOneID, true))
.isInstanceOf(ForbiddenException.class);
cut.getAllUsersByListOfIds(listWithOneID, true))
.isInstanceOf(ForbiddenException.class);
}
}
}
}
}
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.release>17</maven.compiler.release>

<version.keycloak>23.0.4</version.keycloak>
<version.keycloak>25.0.6</version.keycloak>
<version.maven.plugins>3.5.1</version.maven.plugins>

<version.mockito>5.14.2</version.mockito>
<version.assertj>3.26.3</version.assertj>
<version.testcontainers>1.20.3</version.testcontainers>
<version.testcontainers.keycloak>3.3.0</version.testcontainers.keycloak>
<version.testcontainers.keycloak>3.5.1</version.testcontainers.keycloak>
<version.restassured>5.5.0</version.restassured>
<version.junit>5.11.3</version.junit>
<version.log4j>2.24.1</version.log4j>
Expand Down

0 comments on commit 87a5af3

Please sign in to comment.