Search in sources :

Example 1 with DynamicPropertySource

use of org.springframework.test.context.DynamicPropertySource in project pathling by aehrc.

the class SecurityTestForResources method registerProperties.

@DynamicPropertySource
@SuppressWarnings("unused")
static void registerProperties(final DynamicPropertyRegistry registry) {
    // TODO: This is a bit messy - maybe we should abstract the physical warehouse out, so that it
    // could be mocked
    final File warehouseDir = new File(testRootDir, "default");
    assertTrue(warehouseDir.mkdir());
    registry.add("pathling.storage.warehouseUrl", () -> "file://" + testRootDir.toPath().toString().replaceFirst("/$", ""));
}
Also used : File(java.io.File) DynamicPropertySource(org.springframework.test.context.DynamicPropertySource)

Example 2 with DynamicPropertySource

use of org.springframework.test.context.DynamicPropertySource in project pathling by aehrc.

the class ManifestConverterTest method registerProperties.

@DynamicPropertySource
@SuppressWarnings("unused")
static void registerProperties(@Nonnull final DynamicPropertyRegistry registry) {
    final File warehouseDirectory = new File("src/test/resources/test-data");
    registry.add("pathling.storage.warehouseUrl", () -> "file://" + warehouseDirectory.getAbsoluteFile().toPath().toString().replaceFirst("/$", ""));
}
Also used : File(java.io.File) DynamicPropertySource(org.springframework.test.context.DynamicPropertySource)

Aggregations

File (java.io.File)2 DynamicPropertySource (org.springframework.test.context.DynamicPropertySource)2