-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #232 from PLADI-ALM/test/PDS-81-user-builder
[PDS-81/hotfix] user builder id 추가
- Loading branch information
Showing
4 changed files
with
29 additions
and
34 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
src/main/java/com/example/pladialmserver/user/dto/request/EmailPWReq.java
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 |
---|---|---|
@@ -1,14 +1,18 @@ | ||
package com.example.pladialmserver.user.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.validation.constraints.Email; | ||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.Pattern; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class EmailPWReq { | ||
@Schema(type = "String", description = "이메일", example = "[email protected]", required = true) | ||
|
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 |
---|---|---|
|
@@ -62,14 +62,18 @@ void findAvailableResourcesTest() { | |
} | ||
|
||
private User createAndSaveUser(String name, String email, Department department, Affiliation affiliation) { | ||
User user = new User(1L, | ||
name, | ||
email, | ||
"password", | ||
"010-1234-5678", | ||
"testAssets", | ||
department,Role.ADMIN, | ||
affiliation); | ||
User user = User.builder() | ||
.id(1L) | ||
.name("홍길동") | ||
.email("[email protected]") | ||
.password("asdf") | ||
.phone("010-0000-0000") | ||
.department(department) | ||
.role(Role.ADMIN) | ||
.assets("A12345") | ||
.affiliation(affiliation) | ||
.assets("1234545") | ||
.build(); | ||
userRepository.save(user); | ||
return user; | ||
} | ||
|
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 |
---|---|---|
|
@@ -33,17 +33,17 @@ public static CreateUserReq setUpCreateUserReq(String email, String pw){ | |
} | ||
|
||
public static User setUpUser(Long userId, Role role, Department department, Affiliation affiliation, String password){ | ||
return new User( | ||
userId, | ||
"홍길동", | ||
"[email protected]", | ||
password, | ||
"010-0000-0000", | ||
"A12345", | ||
department, | ||
role, | ||
affiliation, | ||
"1234545"); | ||
return User.builder() | ||
.id(userId) | ||
.name("홍길동") | ||
.email("[email protected]") | ||
.password("010-0000-0000") | ||
.phone("010-0000-0000") | ||
.department(department) | ||
.role(role) | ||
.assets("A12345") | ||
.affiliation(affiliation) | ||
.build(); | ||
} | ||
|
||
public static Department setUpDepartment(){ | ||
|