-
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.
[SELC-6086] Feat: Added mobilePhone in updateUser API (#497)
- Loading branch information
1 parent
bc43661
commit 2e9dedd
Showing
8 changed files
with
122 additions
and
30 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 |
---|---|---|
|
@@ -4278,6 +4278,11 @@ | |
"format" : "email", | ||
"example" : "[email protected]" | ||
}, | ||
"mobilePhone" : { | ||
"pattern" : "^\\+?[0-9]{9,15}$", | ||
"type" : "string", | ||
"description" : "User's institutional phone number" | ||
}, | ||
"name" : { | ||
"type" : "string", | ||
"description" : "User's name" | ||
|
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
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 |
---|---|---|
|
@@ -13,7 +13,6 @@ | |
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
|
@@ -46,7 +45,7 @@ void validateNullFields() { | |
Class<? extends Annotation> annotationToCheck = toCheckMap.get(violation.getPropertyPath().toString()); | ||
return !violation.getConstraintDescriptor().getAnnotation().annotationType().equals(annotationToCheck); | ||
}) | ||
.collect(Collectors.toList()); | ||
.toList(); | ||
assertTrue(filteredViolations.isEmpty()); | ||
} | ||
|
||
|
@@ -56,6 +55,7 @@ void validateNotNullFields() { | |
// given | ||
UpdateUserDto model = TestUtils.mockInstance(new UpdateUserDto()); | ||
model.setEmail("[email protected]"); | ||
model.setMobilePhone("1234567890"); | ||
// when | ||
Set<ConstraintViolation<Object>> violations = validator.validate(model); | ||
// then | ||
|
@@ -69,6 +69,7 @@ void validate_emailFieldsNotValid() { | |
HashMap<String, Class<? extends Annotation>> toCheckMap = new HashMap<>(); | ||
toCheckMap.put("email", Email.class); | ||
UpdateUserDto model = TestUtils.mockInstance(new UpdateUserDto()); | ||
model.setMobilePhone("1234567890"); | ||
// when | ||
Set<ConstraintViolation<Object>> violations = validator.validate(model); | ||
// then | ||
|
@@ -77,7 +78,7 @@ void validate_emailFieldsNotValid() { | |
Class<? extends Annotation> annotationToCheck = toCheckMap.get(violation.getPropertyPath().toString()); | ||
return !violation.getConstraintDescriptor().getAnnotation().annotationType().equals(annotationToCheck); | ||
}) | ||
.collect(Collectors.toList()); | ||
.toList(); | ||
assertTrue(filteredViolations.isEmpty()); | ||
} | ||
|
||
|
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,5 +1,6 @@ | ||
{ | ||
"email": "[email protected]", | ||
"mobilePhone": "123456789", | ||
"name": "string", | ||
"surname": "string" | ||
} |