Skip to content

Commit

Permalink
Adjust formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Sep 3, 2024
1 parent 514decb commit 2cefa70
Showing 1 changed file with 25 additions and 30 deletions.
55 changes: 25 additions & 30 deletions test/transformation/TestTransformAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class TestTransformAll {
public static void setUp() throws IOException {
File output = new File(TransformAll.DATA_OUTPUT_FILE);
assertThat(!output.exists() || output.delete()).as("no output file")
.isTrue();
.isTrue();
TransformAll.process("", TransformAll.DATA_OUTPUT_FILE, "", wikidataLookupFilename);
}

Expand All @@ -59,29 +59,29 @@ public static void tearDown() {

@Test
public void multiLangAlternateName() throws IOException {
assertThat(new String(
Files.readAllBytes(Paths.get(TransformAll.DATA_OUTPUT_FILE))))
.as("transformation output with multiLangAlternateName")
.contains("Leibniz Institute").contains("Berlin SBB");
assertThat(new String(
Files.readAllBytes(Paths.get(TransformAll.DATA_OUTPUT_FILE))))
.as("transformation output with multiLangAlternateName")
.contains("Leibniz Institute").contains("Berlin SBB");
}

@Test
public void separateUrlAndProvidesFields() throws IOException {
assertThat(new String(
Files.readAllBytes(Paths.get(TransformAll.DATA_OUTPUT_FILE))))
.as("transformation output with `url` and `provides`")
.contains("https://www.livivo.de/?idb=ZBMED")
.contains("https://www.zbmed.de");
assertThat(new String(
Files.readAllBytes(Paths.get(TransformAll.DATA_OUTPUT_FILE))))
.as("transformation output with `url` and `provides`")
.contains("https://www.livivo.de/?idb=ZBMED")
.contains("https://www.zbmed.de");
}

@Test
public void preferSigelData() throws IOException {
assertThat(new String(
Files.readAllBytes(Paths.get(TransformAll.DATA_OUTPUT_FILE))))
.as("transformation output with preferred Sigel data")
.contains("Hauptabteilung")//
.as("transformation output containing DBS data")
.contains("Roemer-Museum");
assertThat(new String(
Files.readAllBytes(Paths.get(TransformAll.DATA_OUTPUT_FILE))))
.as("transformation output with preferred Sigel data")
.contains("Hauptabteilung")//
.as("transformation output containing DBS data")
.contains("Roemer-Museum");
}

@Test
Expand All @@ -104,22 +104,17 @@ public void process(String obj) {
fixVariables.put("wikidata2gndIdentifier", wikidataLookupFile);
Metafix fixEnriched = new Metafix("conf/fix-enriched.fix", fixVariables);
sourceFileOpener.setReceiver(new LineReader())//
.setReceiver(picaDecoder)//
.setReceiver(new Metafix("conf/fix-sigel.fix"))//
.setReceiver(fixEnriched)//
.setReceiver(encoder);
.setReceiver(picaDecoder)//
.setReceiver(new Metafix("conf/fix-sigel.fix"))//
.setReceiver(fixEnriched)//
.setReceiver(encoder);
sourceFileOpener.process(SIGEL_DUMP_LOCATION);
sourceFileOpener.closeStream();
assertThat(resultCollector.toString())//
.as("contains api description")//
.contains(
"availableChannel[]{1{type[]{1:ServiceChannel,2:WebAPI}serviceType:SRU,serviceUrl:http\\://sru.gbv.de/opac-de-hil2}"//
+ "2{type[]{1:ServiceChannel,2:WebAPI}serviceType:PAIA,serviceUrl:https\\://paia.gbv.de/DE-Hil2/}"//
+ "3{type[]{1:ServiceChannel,2:WebAPI}serviceType:DAIA,serviceUrl:https\\://paia.gbv.de/DE-Hil2/daia}}")
;
.as("contains api description")//
.contains(
"availableChannel[]{1{type[]{1:ServiceChannel,2:WebAPI}serviceType:SRU,serviceUrl:http\\://sru.gbv.de/opac-de-hil2}"//
+ "2{type[]{1:ServiceChannel,2:WebAPI}serviceType:PAIA,serviceUrl:https\\://paia.gbv.de/DE-Hil2/}"//
+ "3{type[]{1:ServiceChannel,2:WebAPI}serviceType:DAIA,serviceUrl:https\\://paia.gbv.de/DE-Hil2/daia}}");
}




}

0 comments on commit 2cefa70

Please sign in to comment.