07-FixCompilationWarningsTest

This commit is contained in:
Adrian-Devries 2025-04-24 12:53:55 +02:00
parent adb4effcf9
commit d22b03cec1
17 changed files with 95 additions and 161 deletions

View file

@ -17,6 +17,7 @@
package de.kosit.validationtool.impl;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertThrows;
import java.net.URI;
import java.net.URISyntaxException;
@ -26,9 +27,7 @@ import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
import javax.xml.transform.URIResolver;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import de.kosit.validationtool.impl.xml.RelativeUriResolver;
@ -49,9 +48,6 @@ public class RelativeUriResolverTest {
}
}
@Rule
public ExpectedException exception = ExpectedException.none();
private URIResolver resolver = new RelativeUriResolver(BASE);
@Test
@ -62,14 +58,12 @@ public class RelativeUriResolverTest {
@Test
public void testNotExisting() throws TransformerException {
this.exception.expect(TransformerException.class);
this.resolver.resolve("ubl-0001", BASE.toASCIIString());
assertThrows(TransformerException.class, () -> this.resolver.resolve("ubl-0001", BASE.toASCIIString()));
}
@Test
public void testOutOfPath() throws TransformerException {
this.exception.expect(TransformerException.class);
this.resolver.resolve("../results/report.xml", BASE.toASCIIString());
assertThrows(TransformerException.class, () -> this.resolver.resolve("../results/report.xml", BASE.toASCIIString()));
}
@Test