Skip to content

Commit fa80a34

Browse files
committed
Added test for AA user security
1 parent fc16dca commit fa80a34

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

server/src/test/java/invite/crm/CRMControllerTest.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,32 @@ void profileWithUidIdp() {
652652
assertEquals(SUPER_ADMIN_NAME, authorisation.role());
653653
}
654654

655+
@Test
656+
void profileWithUidIdpForAttributeAggregation() {
657+
this.seedCRMData();
658+
ProfileResponse profileResponse = given()
659+
.when()
660+
.auth().preemptive().basic("aa", "secret")
661+
.accept(ContentType.JSON)
662+
.contentType(ContentType.JSON)
663+
.queryParam("uid", "guest")
664+
.queryParam("idp", "kb.nl")
665+
.get("/api/external/v1/invite/crm/profile")
666+
.as(new TypeRef<>() {
667+
});
668+
assertEquals(0, profileResponse.code());
669+
assertEquals("OK", profileResponse.message());
670+
assertEquals(1, profileResponse.profiles().size());
671+
672+
Profile profile = profileResponse.profiles().getFirst();
673+
assertEquals(CRM_ORGANIZATION_ID, profile.organisation().get("guid"));
674+
assertEquals(1, profile.authorisations().size());
675+
676+
Authorisation authorisation = profile.authorisations().getFirst();
677+
assertEquals("SUPER_ADMIN", authorisation.abbbrevation());
678+
assertEquals(SUPER_ADMIN_NAME, authorisation.role());
679+
}
680+
655681
@Test
656682
void profileWithIdp() {
657683
this.seedCRMData();

0 commit comments

Comments
 (0)