use of io.gravitee.rest.api.model.configuration.identity.GroupMappingEntity in project gravitee-management-rest-api by gravitee-io.
the class OAuth2AuthenticationResourceTest method mockWrongELGroupsMapping.
private void mockWrongELGroupsMapping() {
GroupMappingEntity condition1 = new GroupMappingEntity();
condition1.setCondition("Some Soup");
condition1.setGroups(Arrays.asList("Example group", "soft user"));
identityProvider.getGroupMappings().add(condition1);
GroupMappingEntity condition2 = new GroupMappingEntity();
condition2.setCondition("{#jsonPath(#profile, '$.identity_provider_id') == 'idp_6'}");
condition2.setGroups(Collections.singletonList("Others"));
identityProvider.getGroupMappings().add(condition2);
GroupMappingEntity condition3 = new GroupMappingEntity();
condition3.setCondition("{#jsonPath(#profile, '$.job_id') != 'API_BREAKER'}");
condition3.setGroups(Collections.singletonList("Api consumer"));
identityProvider.getGroupMappings().add(condition3);
}
use of io.gravitee.rest.api.model.configuration.identity.GroupMappingEntity in project gravitee-management-rest-api by gravitee-io.
the class UserServiceTest method mockGroupsMapping.
private void mockGroupsMapping() {
GroupMappingEntity condition1 = new GroupMappingEntity();
condition1.setCondition("{#jsonPath(#profile, '$.identity_provider_id') == 'idp_5' && #jsonPath(#profile, '$.job_id') != 'API_BREAKER'}");
condition1.setGroups(Arrays.asList("Example group", "soft user"));
GroupMappingEntity condition2 = new GroupMappingEntity();
condition2.setCondition("{#jsonPath(#profile, '$.identity_provider_id') == 'idp_6'}");
condition2.setGroups(Collections.singletonList("Others"));
GroupMappingEntity condition3 = new GroupMappingEntity();
condition3.setCondition("{#jsonPath(#profile, '$.job_id') != 'API_BREAKER'}");
condition3.setGroups(Collections.singletonList("Api consumer"));
when(identityProvider.getGroupMappings()).thenReturn(Arrays.asList(condition1, condition2, condition3));
}
Aggregations