fix tests after changed TempDir dependency

This commit is contained in:
Eduard Heimbuch
2020-05-25 13:55:42 +02:00
parent 060cd6f47e
commit a9d95623b9
3 changed files with 5 additions and 7 deletions

View File

@@ -34,7 +34,6 @@
<version>2.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
</parent> </parent>
<groupId>sonia.scm</groupId>
<artifactId>scm-core</artifactId> <artifactId>scm-core</artifactId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
<name>scm-core</name> <name>scm-core</name>

View File

@@ -34,7 +34,6 @@
<version>2.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
</parent> </parent>
<groupId>sonia.scm</groupId>
<artifactId>scm-dao-xml</artifactId> <artifactId>scm-dao-xml</artifactId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
<name>scm-dao-xml</name> <name>scm-dao-xml</name>

View File

@@ -26,7 +26,7 @@ package sonia.scm.store;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.junitpioneer.jupiter.TempDirectory; import org.junit.jupiter.api.io.TempDir;
import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.junit.jupiter.MockitoExtension;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
@@ -46,11 +46,11 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
@ExtendWith({MockitoExtension.class, TempDirectory.class}) @ExtendWith(MockitoExtension.class)
class TypedStoreContextTest { class TypedStoreContextTest {
@Test @Test
void shouldMarshallAndUnmarshall(@TempDirectory.TempDir Path tempDir) { void shouldMarshallAndUnmarshall(@TempDir Path tempDir) {
TypedStoreContext<Sample> context = context(Sample.class); TypedStoreContext<Sample> context = context(Sample.class);
File file = tempDir.resolve("test.xml").toFile(); File file = tempDir.resolve("test.xml").toFile();
@@ -61,7 +61,7 @@ class TypedStoreContextTest {
} }
@Test @Test
void shouldWorkWithMarshallerAndUnmarshaller(@TempDirectory.TempDir Path tempDir) { void shouldWorkWithMarshallerAndUnmarshaller(@TempDir Path tempDir) {
TypedStoreContext<Sample> context = context(Sample.class); TypedStoreContext<Sample> context = context(Sample.class);
File file = tempDir.resolve("test.xml").toFile(); File file = tempDir.resolve("test.xml").toFile();
@@ -101,7 +101,7 @@ class TypedStoreContextTest {
} }
@Test @Test
void shouldConfigureAdapter(@TempDirectory.TempDir Path tempDir) { void shouldConfigureAdapter(@TempDir Path tempDir) {
TypedStoreParameters<SampleWithAdapter> params = params(SampleWithAdapter.class); TypedStoreParameters<SampleWithAdapter> params = params(SampleWithAdapter.class);
when(params.getAdapters()).thenReturn(Collections.singleton(new AppendingAdapter("!"))); when(params.getAdapters()).thenReturn(Collections.singleton(new AppendingAdapter("!")));