-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use asDto(...) function instead of the direct AdminUserDTO/UserDTO re…
…ferences
- Loading branch information
Showing
10 changed files
with
65 additions
and
65 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
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
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
6 changes: 3 additions & 3 deletions
6
generators/server/templates/src/main/java/package/web/rest/vm/ManagedUserVM.java.ejs
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ import <%=packageName%>.domain.User; | |
import <%=packageName%>.repository.AuthorityRepository; | ||
import <%=packageName%>.repository.UserRepository; | ||
import <%=packageName%>.security.AuthoritiesConstants; | ||
import <%=packageName%>.service.dto.AdminUserDTO; | ||
import <%=packageName%>.service.dto.<%= ${generator.asDto('AdminUser')} %>; | ||
import <%=packageName%>.service.util.RandomUtil; | ||
<%_ if (authenticationType !== 'oauth2') { _%> | ||
import <%=packageName%>.web.rest.errors.EmailAlreadyUsedException; | ||
|
@@ -181,7 +181,7 @@ public class UserServiceIT { | |
userRepository.saveAndFlush(user); | ||
} | ||
final Pageable pageable = Pageable.from(0, (int) userRepository.count()); | ||
final Page<AdminUserDTO> allManagedUsers = userService.getAllManagedUsers(pageable); | ||
final Page<<%= ${generator.asDto('AdminUser')} %>> allManagedUsers = userService.getAllManagedUsers(pageable); | ||
assertThat(allManagedUsers.getContent().stream() | ||
.noneMatch(user -> Constants.ANONYMOUS_USER.equals(user.getLogin()))) | ||
.isTrue(); | ||
|
@@ -304,7 +304,7 @@ public class UserServiceIT { | |
assertThat(testUser4.get().getEmail()).isEqualTo("[email protected]"); | ||
testUser4.get().setActivated(true); | ||
userService.updateUser(new AdminUserDTO(testUser4.get())); | ||
userService.updateUser(new <%= ${generator.asDto('AdminUser')} %>(testUser4.get())); | ||
// Register 4th (already activated) user | ||
Assertions.assertThrows(EmailAlreadyUsedException.class, () -> { | ||
|
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
Oops, something went wrong.