File tree Expand file tree Collapse file tree 3 files changed +14
-13
lines changed
main/java/org/gridsuite/studyconfig/server
test/java/org/gridsuite/studyconfig/server Expand file tree Collapse file tree 3 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 20
20
@ Schema (name = "GlobalFilterDto" , description = "Global filter configuration" )
21
21
public record GlobalFilterInfos (
22
22
23
+ @ JsonInclude (JsonInclude .Include .NON_NULL )
24
+ @ Schema (description = "Global filter UUID" )
25
+ UUID id ,
26
+
23
27
@ JsonInclude (JsonInclude .Include .NON_NULL )
24
28
@ Schema (description = "Generic filter ID" )
25
29
UUID uuid ,
Original file line number Diff line number Diff line change @@ -93,15 +93,16 @@ public static ColumnEntity toColumnEntity(ColumnInfos dto) {
93
93
}
94
94
95
95
public static GlobalFilterInfos toGlobalFilterDto (GlobalFilterEntity entity ) {
96
- return new GlobalFilterInfos (
97
- entity .getUuid (),
98
- entity .getFilterType (),
99
- entity .getFilterSubtype (),
100
- entity .getLabel (),
101
- entity .isRecent (),
102
- entity .getEquipmentType (),
103
- entity .getPath ()
104
- );
96
+ return GlobalFilterInfos .builder ()
97
+ .uuid (entity .getUuid ())
98
+ .filterType (entity .getFilterType ())
99
+ .filterSubtype (entity .getFilterSubtype ())
100
+ .label (entity .getLabel ())
101
+ .recent (entity .isRecent ())
102
+ .equipmentType (entity .getEquipmentType ())
103
+ .path (entity .getPath ())
104
+ .build ();
105
+
105
106
}
106
107
107
108
public static GlobalFilterEntity toGlobalFilterEntity (GlobalFilterInfos dto ) {
Original file line number Diff line number Diff line change @@ -84,10 +84,7 @@ void testConversionToDtoOfSpreadsheetConfig() {
84
84
assertThat (d .columns ().get (1 ).filterValue ()).isNull ();
85
85
// Global filters assertions
86
86
assertThat (d .globalFilters ()).hasSize (2 );
87
- assertThat (d .globalFilters ().get (0 ).id ()).isNotNull ();
88
87
assertThat (d .globalFilters ().get (0 ).label ()).isEqualTo ("GlobalFilter1" );
89
-
90
- assertThat (d .globalFilters ().get (1 ).id ()).isNotNull ();
91
88
assertThat (d .globalFilters ().get (1 ).label ()).isEqualTo ("GlobalFilter2" );
92
89
});
93
90
}
@@ -249,7 +246,6 @@ void testConversionToDtoOfGlobalFilter() {
249
246
assertThat (dto )
250
247
.as ("DTO conversion result" )
251
248
.satisfies (d -> {
252
- assertThat (d .id ()).isEqualTo (uuid );
253
249
assertThat (d .uuid ()).isEqualTo (filterId );
254
250
assertThat (d .label ()).isEqualTo ("TestGlobalFilter" );
255
251
});
You can’t perform that action at this time.
0 commit comments