@@ -28,6 +28,7 @@ class AlignmentPersistenceServiceIT {
28
28
@ Autowired
29
29
private AlignmentPersistenceService alignmentPersistenceService ;
30
30
private Alignment createdAlignment ;
31
+ private final String ALIGNMENT = "Alignment" ;
31
32
32
33
private static ObjectiveAlignment createObjectiveAlignment (Long id ) {
33
34
return ObjectiveAlignment .Builder .builder ().withId (id )
@@ -102,7 +103,7 @@ void updateAlignmentShouldThrowExceptionWhenAlreadyUpdated() {
102
103
OkrResponseStatusException exception = assertThrows (OkrResponseStatusException .class ,
103
104
() -> alignmentPersistenceService .save (updateAlignment ));
104
105
105
- List <ErrorDto > expectedErrors = List .of (new ErrorDto ("DATA_HAS_BEEN_UPDATED" , List .of ("Alignment" )));
106
+ List <ErrorDto > expectedErrors = List .of (new ErrorDto ("DATA_HAS_BEEN_UPDATED" , List .of (ALIGNMENT )));
106
107
107
108
assertEquals (UNPROCESSABLE_ENTITY , exception .getStatusCode ());
108
109
assertThat (expectedErrors ).hasSameElementsAs (exception .getErrors ());
@@ -114,7 +115,7 @@ void findByAlignedObjectiveIdShouldReturnAlignmentModel() {
114
115
Alignment alignment = alignmentPersistenceService .findByAlignedObjectiveId (4L );
115
116
116
117
assertNotNull (alignment );
117
- assertEquals (alignment .getAlignedObjective ().getId (), 4 );
118
+ assertEquals (4 , alignment .getAlignedObjective ().getId ());
118
119
}
119
120
120
121
@ Test
@@ -162,7 +163,7 @@ void recreateEntityShouldUpdateAlignmentNoTypeChange() {
162
163
() -> alignmentPersistenceService .findById (alignmentId ));
163
164
164
165
List <ErrorDto > expectedErrors = List
165
- .of (ErrorDto .of ("MODEL_WITH_ID_NOT_FOUND" , List .of ("Alignment" , alignmentId )));
166
+ .of (ErrorDto .of ("MODEL_WITH_ID_NOT_FOUND" , List .of (ALIGNMENT , alignmentId )));
166
167
167
168
assertEquals (NOT_FOUND , exception .getStatusCode ());
168
169
assertThat (expectedErrors ).hasSameElementsAs (exception .getErrors ());
@@ -202,7 +203,7 @@ void recreateEntityShouldUpdateAlignmentWithTypeChange() {
202
203
() -> alignmentPersistenceService .findById (alignmentId ));
203
204
204
205
List <ErrorDto > expectedErrors = List
205
- .of (ErrorDto .of ("MODEL_WITH_ID_NOT_FOUND" , List .of ("Alignment" , alignmentId )));
206
+ .of (ErrorDto .of ("MODEL_WITH_ID_NOT_FOUND" , List .of (ALIGNMENT , alignmentId )));
206
207
207
208
assertEquals (NOT_FOUND , exception .getStatusCode ());
208
209
assertThat (expectedErrors ).hasSameElementsAs (exception .getErrors ());
0 commit comments