Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
196e173a
by Tony Chemit at 2024-06-26T08:31:50+02:00
-
2cb15c22
by Tony Chemit at 2024-06-26T08:32:13+02:00
2 changed files:
- core/services/test/src/main/java/fr/ird/observe/services/service/ValidateServiceFixtures.java
- toolkit/api-validation/src/main/java/fr/ird/observe/validation/validators/referential/IdDtoReferentialDisabledFieldValidationSupport.java
Changes:
| ... | ... | @@ -115,7 +115,7 @@ public class ValidateServiceFixtures extends GeneratedValidateServiceFixtures { |
| 115 | 115 | }
|
| 116 | 116 | |
| 117 | 117 | private void assertResult(ValidationResult actual, ValidationResult expected) {
|
| 118 | - Assert.assertEquals(actual.getNodes().size(), expected.getNodes().size());
|
|
| 118 | + Assert.assertEquals(expected.getNodes().size(), actual.getNodes().size());
|
|
| 119 | 119 | |
| 120 | 120 | Iterator<ValidationResultDto> expectedIterator = expected.getNodes().iterator();
|
| 121 | 121 | for (ValidationResultDto actualNode : actual.getNodes()) {
|
| ... | ... | @@ -125,9 +125,9 @@ public class ValidateServiceFixtures extends GeneratedValidateServiceFixtures { |
| 125 | 125 | }
|
| 126 | 126 | |
| 127 | 127 | private void assertResult(ValidationResultDto actual, ValidationResultDto expected) {
|
| 128 | - Assert.assertEquals(actual.getDatum().getId(), expected.getDatum().getId());
|
|
| 129 | - Assert.assertEquals(actual.getMessages(), expected.getMessages());
|
|
| 130 | - Assert.assertEquals(actual.getChildCount(), expected.getChildCount());
|
|
| 128 | + Assert.assertEquals(expected.getDatum().getId(), actual.getDatum().getId());
|
|
| 129 | + Assert.assertEquals(expected.getMessages(), actual.getMessages());
|
|
| 130 | + Assert.assertEquals(expected.getChildCount(), actual.getChildCount());
|
|
| 131 | 131 | if (actual.getChildren() != null) {
|
| 132 | 132 | Iterator<ValidationResultDto> actualChildren = actual.getChildren().iterator();
|
| 133 | 133 | Iterator<ValidationResultDto> expectedChildren = expected.getChildren().iterator();
|
| ... | ... | @@ -106,7 +106,8 @@ public abstract class IdDtoReferentialDisabledFieldValidationSupport extends Nui |
| 106 | 106 | referenceValue = referentialDtoReference.toString();
|
| 107 | 107 | } else {
|
| 108 | 108 | if (referenceType == null) {
|
| 109 | - referenceType = I18nDecoratorHelper.getType(referentialDtoReference.getReferenceType());
|
|
| 109 | + DecoratorService decoratorService = (DecoratorService) stack.findValue("decoratorService");
|
|
| 110 | + referenceType = I18nDecoratorHelper.getType(decoratorService.getReferentialLocale().getLocale(), referentialDtoReference.getReferenceType());
|
|
| 110 | 111 | }
|
| 111 | 112 | }
|
| 112 | 113 | try {
|