Skip to content

Commit 90c3dd2

Browse files
committed
creating reference reports by annotation
1 parent 7a5cb35 commit 90c3dd2

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

curation-api/src/test/java/eu/clarin/cmdi/curation/api/CollectionTest.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import eu.clarin.cmdi.curation.api.report.collection.CollectionReport;
99
import eu.clarin.cmdi.curation.api.report.instance.CMDInstanceReport;
1010
import eu.clarin.cmdi.curation.api.exception.MalFunctioningProcessorException;
11+
import jakarta.annotation.PostConstruct;
1112
import lombok.extern.slf4j.Slf4j;
1213
import org.junit.jupiter.api.*;
1314
import org.mockserver.springtest.MockServerTest;
@@ -55,7 +56,7 @@ public class CollectionTest extends BaseTest {
5556
String xmlContent;
5657

5758
@Autowired
58-
public CollectionTest(ApiConfig conf, CurationModule curation) throws IOException {
59+
public CollectionTest(ApiConfig conf, CurationModule curation) throws IOException, MalFunctioningProcessorException {
5960

6061

6162
this.conf = conf;
@@ -92,10 +93,20 @@ public CollectionTest(ApiConfig conf, CurationModule curation) throws IOExceptio
9293

9394
Files.copy(file099Path, this.file099CopyPath, StandardCopyOption.REPLACE_EXISTING);
9495

95-
9696
}
9797
}
9898

99+
@BeforeAll
100+
void createReferenceReports() {
101+
102+
// now we create a collection report from our collection
103+
assertDoesNotThrow(() -> this.collectionReport = this.curation.processCollection(this.collectionPath));
104+
105+
// and an instance report in collection mode as reference
106+
assertDoesNotThrow(() -> this.instanceReport = this.curation.processCMDInstance(collectionPath.resolve("001.xml")));
107+
108+
}
109+
99110
@AfterEach
100111
void replaceFile099() {
101112

@@ -107,16 +118,6 @@ void replaceFile099() {
107118
log.error("", e);
108119
}
109120
}
110-
@Test
111-
void aaCreateReferenceReports() {
112-
113-
// now we create a collection report from our collection
114-
assertDoesNotThrow(() -> this.collectionReport = this.curation.processCollection(this.collectionPath));
115-
116-
// and an instance report in collection mode as reference
117-
assertDoesNotThrow(() -> this.instanceReport = this.curation.processCMDInstance(collectionPath.resolve("001.xml")));
118-
119-
}
120121

121122
@Test
122123
void collection() {

0 commit comments

Comments
 (0)