use of io.gravitee.rest.api.model.configuration.identity.IdentityProviderType in project gravitee-management-rest-api by gravitee-io.
the class OAuth2AuthenticationResourceTest method init.
@Before
public void init() {
identityProvider = new SocialIdentityProviderEntity() {
@Override
public String getId() {
return USER_SOURCE_OAUTH2;
}
@Override
public IdentityProviderType getType() {
return IdentityProviderType.OIDC;
}
@Override
public String getAuthorizationEndpoint() {
return null;
}
@Override
public String getTokenEndpoint() {
return "http://localhost:" + wireMockRule.port() + "/token";
}
@Override
public String getUserInfoEndpoint() {
return "http://localhost:" + wireMockRule.port() + "/userinfo";
}
@Override
public List<String> getRequiredUrlParams() {
return null;
}
@Override
public List<String> getOptionalUrlParams() {
return null;
}
@Override
public List<String> getScopes() {
return null;
}
@Override
public String getDisplay() {
return null;
}
@Override
public String getColor() {
return null;
}
@Override
public String getClientSecret() {
return "the_client_secret";
}
private Map<String, String> userProfileMapping = new HashMap<>();
@Override
public Map<String, String> getUserProfileMapping() {
return userProfileMapping;
}
private List<GroupMappingEntity> groupMappings = new ArrayList<>();
@Override
public List<GroupMappingEntity> getGroupMappings() {
return groupMappings;
}
private List<RoleMappingEntity> roleMappings = new ArrayList<>();
@Override
public List<RoleMappingEntity> getRoleMappings() {
return roleMappings;
}
@Override
public boolean isEmailRequired() {
return true;
}
};
when(socialIdentityProviderService.findById(eq(USER_SOURCE_OAUTH2), any())).thenReturn(identityProvider);
cleanEnvironment();
cleanRolesGroupMapping();
reset(userService, groupService, roleService, membershipService);
}
use of io.gravitee.rest.api.model.configuration.identity.IdentityProviderType in project gravitee-management-rest-api by gravitee-io.
the class OAuth2AuthenticationResourceTest method init.
@Before
public void init() {
identityProvider = new SocialIdentityProviderEntity() {
private Map<String, String> userProfileMapping = new HashMap<>();
private List<GroupMappingEntity> groupMappings = new ArrayList<>();
private List<RoleMappingEntity> roleMappings = new ArrayList<>();
@Override
public String getId() {
return USER_SOURCE_OAUTH2;
}
@Override
public IdentityProviderType getType() {
return IdentityProviderType.OIDC;
}
@Override
public String getAuthorizationEndpoint() {
return null;
}
@Override
public String getTokenEndpoint() {
return "http://localhost:" + wireMockRule.port() + "/token";
}
@Override
public String getUserInfoEndpoint() {
return "http://localhost:" + wireMockRule.port() + "/userinfo";
}
@Override
public List<String> getRequiredUrlParams() {
return null;
}
@Override
public List<String> getOptionalUrlParams() {
return null;
}
@Override
public List<String> getScopes() {
return null;
}
@Override
public String getDisplay() {
return null;
}
@Override
public String getColor() {
return null;
}
@Override
public String getClientSecret() {
return "the_client_secret";
}
@Override
public Map<String, String> getUserProfileMapping() {
return userProfileMapping;
}
@Override
public List<GroupMappingEntity> getGroupMappings() {
return groupMappings;
}
@Override
public List<RoleMappingEntity> getRoleMappings() {
return roleMappings;
}
@Override
public boolean isEmailRequired() {
return true;
}
};
when(socialIdentityProviderService.findById(eq(USER_SOURCE_OAUTH2), any())).thenReturn(identityProvider);
cleanEnvironment();
cleanRolesGroupMapping();
reset(userService, groupService, roleService, membershipService);
}
Aggregations