@@ -50,10 +50,10 @@ class StorageLibraryTest {
50
50
@ Mock
51
51
private ItemWriter <Molecule > itemWriter ;
52
52
53
- private final String LIBRARY_ID = UUID .randomUUID ().toString ();
53
+ private static final String LIBRARY_ID = UUID .randomUUID ().toString ();
54
54
55
55
@ ParameterizedTest
56
- @ EnumSource (value = LibraryType .class , names = {"MOLECULES " , "REACTIONS " })
56
+ @ EnumSource (value = LibraryType .class , names = {"molecules " , "reactions " })
57
57
void testCreateLibrary (LibraryType libraryType ) {
58
58
Instant now = Instant .now ().truncatedTo (ChronoUnit .MICROS );
59
59
String libraryName = "test_create_library_" + libraryType ;
@@ -85,12 +85,12 @@ void testCreateLibrary_withPropertiesMapping() {
85
85
library .setUpdatedStamp (now .plusSeconds (1 ));
86
86
library .setId (LIBRARY_ID );
87
87
88
- when (storageLibrary .createLibrary (anyString (), eq (LibraryType .MOLECULES ), eq (propertiesMapping ), any ()))
88
+ when (storageLibrary .createLibrary (anyString (), eq (LibraryType .molecules ), eq (propertiesMapping ), any ()))
89
89
.thenReturn (library );
90
90
when (storageLibrary .getPropertiesMapping (LIBRARY_ID )).thenReturn (propertiesMapping );
91
91
92
92
Library result = storageLibrary .createLibrary ("test_create_library_properties_mapping" ,
93
- LibraryType .MOLECULES , propertiesMapping , null );
93
+ LibraryType .molecules , propertiesMapping , null );
94
94
95
95
assertEquals ("test_create_library_properties_mapping" , result .getName ());
96
96
assertEquals (result .getCreatedStamp (), result .getUpdatedStamp ());
@@ -128,7 +128,7 @@ void testCreateLibrary_addExistingPropertyMapping() {
128
128
doThrow (new StorageException ("A library %s already contains the following properties test1" .formatted (LIBRARY_ID )))
129
129
.when (storageLibrary ).addPropertiesMapping (eq (LIBRARY_ID ), eq (duplicate ));
130
130
131
- Library result = storageLibrary .createLibrary ("lib" , LibraryType .MOLECULES , initial , null );
131
+ Library result = storageLibrary .createLibrary ("lib" , LibraryType .molecules , initial , null );
132
132
133
133
Exception exception = assertThrows (StorageException .class , () ->
134
134
storageLibrary .addPropertiesMapping (result .getId (), duplicate )
@@ -151,7 +151,7 @@ void testCreateLibrary_updatePropertyMapping() {
151
151
Map .of ("test1" , new Property ("new test 1" , Property .PropertyType .STRING , 1 , true , false ))
152
152
);
153
153
154
- Library result = storageLibrary .createLibrary ("lib" , LibraryType .MOLECULES , Map .of (), null );
154
+ Library result = storageLibrary .createLibrary ("lib" , LibraryType .molecules , Map .of (), null );
155
155
boolean status = storageLibrary .updatePropertiesMapping (result .getId (), newMapping );
156
156
assertTrue (status );
157
157
@@ -173,7 +173,7 @@ void testCreateLibrary_updateNonExistingPropertyMapping() {
173
173
doThrow (new StorageException ("A library %s does not contain the following properties test4" .formatted (LIBRARY_ID )))
174
174
.when (storageLibrary ).updatePropertiesMapping (eq (LIBRARY_ID ), eq (newMapping ));
175
175
176
- Library result = storageLibrary .createLibrary ("lib" , LibraryType .MOLECULES , Map .of (), null );
176
+ Library result = storageLibrary .createLibrary ("lib" , LibraryType .molecules , Map .of (), null );
177
177
Exception exception = assertThrows (StorageException .class , () ->
178
178
storageLibrary .updatePropertiesMapping (result .getId (), newMapping )
179
179
);
@@ -208,7 +208,7 @@ void testCreateLibrary_updateGeneratedPropertyMapping() {
208
208
}
209
209
210
210
@ ParameterizedTest
211
- @ EnumSource (value = LibraryType .class , names = {"MOLECULES " , "REACTIONS " })
211
+ @ EnumSource (value = LibraryType .class , names = {"molecules " , "reactions " })
212
212
void testUpdateLibrary (LibraryType libraryType ) {
213
213
Library library = new Library ();
214
214
library .setId (LIBRARY_ID );
@@ -240,7 +240,7 @@ void testUpdateLibrary_parallel() throws InterruptedException {
240
240
when (storageLibrary .createLibrary (any (), any (), any ())).thenReturn (baseLibrary );
241
241
when (storageLibrary .updateLibrary (any ())).thenAnswer (invocation -> invocation .getArgument (0 ));
242
242
243
- Library library = storageLibrary .createLibrary (libraryName , LibraryType .MOLECULES , null );
243
+ Library library = storageLibrary .createLibrary (libraryName , LibraryType .molecules , null );
244
244
245
245
int threadCounts = 10 ;
246
246
CountDownLatch latch = new CountDownLatch (threadCounts );
@@ -275,7 +275,7 @@ void testUpdateLibrary_parallel() throws InterruptedException {
275
275
}
276
276
277
277
@ ParameterizedTest
278
- @ EnumSource (value = LibraryType .class , names = {"MOLECULES " , "REACTIONS " })
278
+ @ EnumSource (value = LibraryType .class , names = {"molecules " , "reactions " })
279
279
void testDeleteLibrary (LibraryType libraryType ) {
280
280
Library library = new Library ();
281
281
library .setId (LIBRARY_ID );
@@ -291,7 +291,7 @@ void testDeleteLibrary(LibraryType libraryType) {
291
291
}
292
292
293
293
@ ParameterizedTest
294
- @ EnumSource (value = LibraryType .class , names = {"METRICS " , "ANY " })
294
+ @ EnumSource (value = LibraryType .class , names = {"metrics " , "any " })
295
295
void testDeleteLibraryWrongType (LibraryType libraryType ) {
296
296
Library library = new Library ();
297
297
library .setId ("1" );
0 commit comments