-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default user attributes now configurable (#128)
* Default user attributes now configurable * Update assertion in create user test
- Loading branch information
Showing
3 changed files
with
13 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
import org.overture.ego.repository.queryspecification.UserSpecification; | ||
import org.overture.ego.token.IDToken; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.stereotype.Service; | ||
|
@@ -50,8 +51,10 @@ public class UserService extends BaseService<User, UUID> { | |
Constants | ||
*/ | ||
// DEFAULTS | ||
private final static String DEFAULT_USER_ROLE = UserRole.USER.toString(); | ||
private final static String DEFAULT_USER_STATUS = UserStatus.PENDING.toString(); | ||
@Value("${default.user.role}") | ||
private String DEFAULT_USER_ROLE; | ||
@Value("${default.user.status}") | ||
private String DEFAULT_USER_STATUS; | ||
|
||
// DEMO USER | ||
private final static String DEMO_USER_NAME = "[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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,7 @@ public void testCreateFromIDToken() { | |
assertThat(idTokenUser.getEmail()).isEqualTo("[email protected]"); | ||
assertThat(idTokenUser.getFirstName()).isEqualTo("User"); | ||
assertThat(idTokenUser.getLastName()).isEqualTo("User"); | ||
assertThat(idTokenUser.getStatus()).isEqualTo("Pending"); | ||
assertThat(idTokenUser.getStatus()).isEqualTo("Approved"); | ||
assertThat(idTokenUser.getRole()).isEqualTo("USER"); | ||
} | ||
|
||
|