Skip to content

Commit ed14d8e

Browse files
committed
issue #289
1 parent 7c13ba9 commit ed14d8e

File tree

5 files changed

+15
-32
lines changed

5 files changed

+15
-32
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
import org.mockserver.logging.MockServerLogger;
77
import org.mockserver.socket.tls.KeyStoreFactory;
88
import org.mockserver.springtest.MockServerTest;
9+
import org.springframework.core.io.ClassPathResource;
910

1011
import javax.net.ssl.HttpsURLConnection;
1112
import java.io.IOException;
1213
import java.net.URISyntaxException;
14+
import java.nio.charset.StandardCharsets;
1315
import java.nio.file.Files;
1416
import java.nio.file.Paths;
1517

@@ -28,7 +30,7 @@ public static void init() throws IOException {
2830
HttpsURLConnection.setDefaultSSLSocketFactory(new KeyStoreFactory(new MockServerLogger()).sslContext().getSocketFactory());
2931
}
3032
@BeforeEach
31-
public void createExpectations() throws URISyntaxException, IOException {
33+
public void createExpectations() throws IOException {
3234
this.mockServerClient
3335
.when(
3436
request()
@@ -56,7 +58,7 @@ public void createExpectations() throws URISyntaxException, IOException {
5658
)
5759
.respond(
5860
response()
59-
.withBody(Files.readString(Paths.get(getClass().getResource("/profile/teiHeader.xsd").toURI())))
61+
.withBody(new String(new ClassPathResource("profile/teiHeader.xsd").getInputStream().readAllBytes(), StandardCharsets.UTF_8))
6062
);
6163
this.mockServerClient
6264
.when(

curation-cr/src/main/java/eu/clarin/cmdi/curation/cr/profile_parser/CMDI1_2_ProfileParser.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
import eu.clarin.cmdi.curation.cr.profile_parser.CMDINode.Component;
99
import eu.clarin.cmdi.curation.cr.profile_parser.CRElement.NodeType;
1010
import org.springframework.context.annotation.Lazy;
11+
import org.springframework.core.io.ClassPathResource;
1112
import org.springframework.stereotype.Service;
1213

1314
import java.io.IOException;
1415
import java.net.URISyntaxException;
16+
import java.nio.charset.StandardCharsets;
1517
import java.nio.file.Files;
1618
import java.nio.file.Paths;
1719
import java.util.Collection;
@@ -38,7 +40,7 @@ public CMDI1_2_ProfileParser(CCRService ccrService, CRConfig crConfig, ProfileCa
3840

3941
super(ccrService, crConfig);
4042

41-
String schemaString = Files.readString(Paths.get(getClass().getResource("/cmd-envelop.xsd").toURI()));
43+
String schemaString = new String(new ClassPathResource("cmd-envelop.xsd").getInputStream().readAllBytes(), StandardCharsets.UTF_8);
4244

4345
VTDGen vg = new VTDGen();
4446

curation-cr/src/test/java/eu/clarin/cmdi/curation/cr/CRServiceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void connectionTimeout() throws NoCRCacheEntryException, CCRServiceNotAvailableE
123123
}
124124

125125
@Test
126-
void nonParseableResult() throws CCRServiceNotAvailableException, PPHCacheException, NoCRCacheEntryException {
126+
void nonParseableResult() throws CCRServiceNotAvailableException, PPHCacheException {
127127

128128
this.mockServerClient
129129
.when(
@@ -151,7 +151,7 @@ void nonParseableResult() throws CCRServiceNotAvailableException, PPHCacheExcept
151151
}
152152

153153
@Test
154-
void isPublic() throws URISyntaxException, IOException {
154+
void isPublic() {
155155

156156
this.mockServerClient
157157
.when(

curation-web/src/test/java/eu/clarin/cmdi/curation/web/controller/BaseCtlTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
import org.mockserver.logging.MockServerLogger;
88
import org.mockserver.socket.tls.KeyStoreFactory;
99
import org.mockserver.springtest.MockServerTest;
10+
import org.springframework.core.io.ClassPathResource;
1011
import org.springframework.test.web.servlet.MockMvc;
1112

1213
import javax.net.ssl.HttpsURLConnection;
1314
import java.io.IOException;
1415
import java.net.URISyntaxException;
16+
import java.nio.charset.StandardCharsets;
1517
import java.nio.file.Files;
1618
import java.nio.file.Paths;
1719

@@ -42,7 +44,7 @@ public static void init() throws IOException {
4244
HttpsURLConnection.setDefaultSSLSocketFactory(new KeyStoreFactory(new MockServerLogger()).sslContext().getSocketFactory());
4345
}
4446
@BeforeEach
45-
public void createExpectations() throws URISyntaxException, IOException {
47+
public void createExpectations() throws IOException {
4648
this.mockServerClient
4749
.when(
4850
request()
@@ -70,7 +72,7 @@ public void createExpectations() throws URISyntaxException, IOException {
7072
)
7173
.respond(
7274
response()
73-
.withBody(Files.readString(Paths.get(getClass().getResource("/testfiles/teiHeader.xsd").toURI())))
75+
.withBody(new String(new ClassPathResource("testfiles/teiHeader.xsd").getInputStream().readAllBytes(), StandardCharsets.UTF_8))
7476
);
7577
this.mockServerClient
7678
.when(

pom.xml

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.springframework.boot</groupId>
66
<artifactId>spring-boot-starter-parent</artifactId>
7-
<version>3.4.4</version>
7+
<version>3.5.5</version>
88
<relativePath/> <!-- lookup parent from repository -->
99
</parent>
1010
<groupId>eu.clarin.cmdi</groupId>
@@ -22,7 +22,7 @@
2222
<maven.compiler.target>21</maven.compiler.target>
2323
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2424
<linkchecker-persistence.version>2.0.1</linkchecker-persistence.version>
25-
<revision>7.4.0</revision>
25+
<revision>7.5.0-SNAPSHOT</revision>
2626
<vlo.version>4.12.1</vlo.version>
2727
<vtd.version>2.11</vtd.version>
2828
<saxon.version>12.3</saxon.version>
@@ -82,29 +82,6 @@
8282
<argLine>-XX:+EnableDynamicAgentLoading</argLine>
8383
</configuration>
8484
</plugin>
85-
<!--
86-
<plugin>
87-
<groupId>org.apache.maven.plugins</groupId>
88-
<artifactId>maven-resources-plugin</artifactId>
89-
<executions>
90-
<execution>
91-
<id>copy-caches</id>
92-
<phase>test</phase>
93-
<goals>
94-
<goal>copy-resources</goal>
95-
</goals>
96-
<configuration>
97-
<outputDirectory>${java.io.tmpdir}/ehtestcache</outputDirectory>
98-
<resources>
99-
<resource>
100-
<directory>ehtestcache</directory>
101-
</resource>
102-
</resources>
103-
</configuration>
104-
</execution>
105-
</executions>
106-
</plugin>
107-
-->
10885
</plugins>
10986
</build>
11087
<repositories>

0 commit comments

Comments
 (0)