@@ -141,19 +141,22 @@ void should_HaveBidirectionalRelation_Between_RoCrateJavaAndItsAction(@TempDir P
141
141
}
142
142
143
143
@ Test
144
- void should_AccumulateActions_When_WritingMultipleTimes (@ TempDir Path tempDir ) throws IOException {
144
+ void should_AccumulateActions_When_WritingMultipleTimes (@ TempDir Path tempDir ) throws IOException , InterruptedException {
145
145
// Create and write crate first time
146
146
RoCrate crate = new RoCrate .RoCrateBuilder ().build ();
147
147
validateCrate (crate );
148
148
149
149
Path outputPath = tempDir .resolve ("test-crate" );
150
150
Writers .newFolderWriter ().save (crate , outputPath .toString ());
151
151
validateCrate (Readers .newFolderReader ().readCrate (outputPath .toString ()));
152
+ Thread .sleep (10 );
152
153
153
154
// Write same crate two more times to simulate updates
154
155
Writers .newFolderWriter ().save (crate , outputPath .toString ());
156
+ Thread .sleep (10 );
155
157
Writers .newFolderWriter ().save (crate , outputPath .toString ());
156
158
validateCrate (Readers .newFolderReader ().readCrate (outputPath .toString ()));
159
+ Thread .sleep (10 );
157
160
158
161
// Read and print metadata for debugging
159
162
String metadata = Files .readString (outputPath .resolve ("ro-crate-metadata.json" ));
@@ -354,18 +357,14 @@ void should_AddProvenanceInfo_When_ModifyingExistingCrateWithoutProvenance(@Temp
354
357
}
355
358
356
359
@ Test
357
- void should_PreserveExistingProvenance_When_ModifyingCrate (@ TempDir Path tempDir ) throws IOException {
360
+ void should_PreserveExistingProvenance_When_ModifyingCrate (@ TempDir Path tempDir ) throws IOException , InterruptedException {
358
361
// First create a crate with normal provenance
359
362
RoCrate originalCrate = new RoCrate .RoCrateBuilder ().build ();
360
363
validateCrate (originalCrate );
361
364
362
365
Path outputPath = tempDir .resolve ("test-crate" );
363
366
Writers .newFolderWriter ().save (originalCrate , outputPath .toString ());
364
- try {
365
- Thread .sleep (10 );
366
- } catch (InterruptedException e ) {
367
- // ignore
368
- }
367
+ Thread .sleep (10 );
369
368
370
369
// Now read and modify the crate
371
370
RoCrate modifiedCrate = Readers .newFolderReader ().readCrate (outputPath .toString ());
0 commit comments