in component-test/src/main/java/IdentityApiDocumentation.java [767:806]
public void documentGetApplicationPermissions ( ) throws InterruptedException {
try (final AutoUserContext ignored
= tenantApplicationSecurityEnvironment.createAutoSeshatContext()) {
final String appIdentifier = "testApp" + RandomStringUtils.randomNumeric(3) + "-v1";
final RsaKeyPairFactory.KeyPairHolder keyPair = RsaKeyPairFactory.createKeyPair();
final String appTimeStamp = keyPair.getTimestamp();
final Signature signature = new Signature(keyPair.getPublicKeyMod(), keyPair.getPublicKeyExp());
getTestSubject().setApplicationSignature(appIdentifier, appTimeStamp, signature);
this.eventRecorder.wait(EventConstants.OPERATION_PUT_APPLICATION_SIGNATURE, new ApplicationSignatureEvent(appIdentifier, keyPair.getTimestamp()));
final Permission firstPermission = new Permission(PermittableGroupIds.IDENTITY_MANAGEMENT, Sets.newHashSet(AllowedOperation.CHANGE));
createApplicationPermission(appIdentifier, firstPermission);
final Permission secondPermission = new Permission(PermittableGroupIds.ROLE_MANAGEMENT, Sets.newHashSet(AllowedOperation.DELETE));
createApplicationPermission(appIdentifier, secondPermission);
try {
this.mockMvc.perform(get("/applications/" + appIdentifier + "/permissions")
.accept(MediaType.ALL_VALUE)
.contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(status().isOk())
.andDo(document("document-get-application-permissions", preprocessResponse(prettyPrint()),
responseFields(
fieldWithPath("[].permittableEndpointGroupIdentifier").description("first permittable group endpoint identifier"),
fieldWithPath("[].allowedOperations").type("Set<AllowedOperation>").description("Set of Allowed Operations"),
fieldWithPath("[1].permittableEndpointGroupIdentifier").description("second permittable group endpoint identifier"),
fieldWithPath("[1].allowedOperations").type("Set<AllowedOperation>").description("Set of Allowed Operations")
)
));
} catch (Exception e) {
e.printStackTrace();
}
}
}