-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
22 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,10 +46,10 @@ public class AdminControllerIT extends IntegrationTest { | |
roles = {STUDY_COORDINATOR}) | ||
public void shouldCreateUserOnFirstLoginSuccessfully() throws Exception { | ||
stubFor( | ||
WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a79") | ||
WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a79") | ||
.willReturn(okJson( | ||
"{\"id\": \"b59e5edb-3121-4e0a-8ccb-af6798207a79\",\"username\": \"new-user\"}"))); | ||
stubFor(WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a79/role-mappings/realm") | ||
stubFor(WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a79/role-mappings/realm") | ||
.willReturn(okJson("[{\"id\":\"12345-2f04-4356-8f34-12345\",\"name\":\"STUDY_COORDINATOR\",\"composite\":false,\"clientRole\":false,\"containerId\":\"Num\"}]"))); | ||
mockMvc | ||
.perform( | ||
|
@@ -65,7 +65,7 @@ public void shouldCreateUserOnFirstLoginSuccessfully() throws Exception { | |
roles = {SUPER_ADMIN, ORGANIZATION_ADMIN}) | ||
public void shouldApproveUserSuccessfully() { | ||
stubFor( | ||
WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73") | ||
WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73") | ||
.willReturn(okJson( | ||
"{\"id\": \"b59e5edb-3121-4e0a-8ccb-af6798207a73\",\"username\": \"new-user\", \"firstname\":\"John\", \"email\": \"[email protected]\"}"))); | ||
mockMvc | ||
|
@@ -81,11 +81,11 @@ public void shouldApproveUserSuccessfully() { | |
@WithMockNumUser(roles = {SUPER_ADMIN}) | ||
public void shouldUpdateUserStatusSuccessfully() { | ||
stubFor( | ||
WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73") | ||
WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73") | ||
.willReturn(okJson( | ||
"{\"id\": \"b59e5edb-3121-4e0a-8ccb-af6798207a73\",\"username\": \"new-user\", \"firstname\":\"John\", \"email\": \"[email protected]\", \"enabled\": \"true\"}"))); | ||
stubFor(WireMock.put("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73").willReturn(okJson("[]"))); | ||
stubFor(WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73/role-mappings/realm") | ||
stubFor(WireMock.put("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73").willReturn(okJson("[]"))); | ||
stubFor(WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73/role-mappings/realm") | ||
.willReturn(okJson("[{\"id\":\"12345-2f04-1156-8f34-12345\",\"name\":\"RESEARCHER\",\"composite\":false,\"clientRole\":false,\"containerId\":\"Num\"}]"))); | ||
mockMvc | ||
.perform( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,13 +32,13 @@ public abstract class IntegrationTest { | |
|
||
public static final String UNAUTHORIZED_USER_ID = "b59e5edb-3121-4e0a-8ccb-af6798207a73"; | ||
private static final String IDENTITY_PROVIDER_URL = | ||
"/auth/realms/Num/protocol/openid-connect/certs"; | ||
"/realms/Num/protocol/openid-connect/certs"; | ||
private static final String IDENTITY_PROVIDER_TOKEN_ENDPOINT = | ||
"/auth/realms/Num/protocol/openid-connect/token"; | ||
private static final String USER_ENDPOINT_USER1 = "/auth/admin/realms/Num/users/user1"; | ||
private static final String USER_ENDPOINT_USER2 = "/auth/admin/realms/Num/users/user2"; | ||
"/realms/Num/protocol/openid-connect/token"; | ||
private static final String USER_ENDPOINT_USER1 = "/admin/realms/Num/users/user1"; | ||
private static final String USER_ENDPOINT_USER2 = "/admin/realms/Num/users/user2"; | ||
private static final String USER_ENDPOINT_ALL_APPROVERS = | ||
"/auth/admin/realms/Num/roles/STUDY_APPROVER/users"; | ||
"/admin/realms/Num/roles/STUDY_APPROVER/users"; | ||
private static final String EHR_BASE_URL = "/ehrbase/rest/openehr/v1/definition/template/adl1.4/"; | ||
|
||
@ClassRule | ||
|
@@ -75,9 +75,9 @@ public void setup() { | |
.willReturn( | ||
okJson( | ||
"[{\"template_id\": \"IDCR - Immunisation summary.v0\",\"concept\": \"IDCR - Immunisation summary.v0\",\"archetype_id\": \"openEHR-EHR-COMPOSITION.health_summary.v1\",\"created_timestamp\": \"2020-11-25T16:19:37.812Z\"}]"))); | ||
stubFor(WireMock.get("/auth/admin/realms/Num/roles/SUPER_ADMIN/users").willReturn(okJson("[]"))); | ||
stubFor(WireMock.get("/admin/realms/Num/roles/SUPER_ADMIN/users").willReturn(okJson("[]"))); | ||
stubFor( | ||
WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a72") | ||
WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a72") | ||
.willReturn(okJson( | ||
"{\"id\": \"b59e5edb-3121-4e0a-8ccb-af6798207a72\",\"username\": \"admin-user\", \"firstname\":\"Admin\", \"email\": \"[email protected]\"}"))); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters