Search in sources :

Example 1 with PlanFiles

use of com.djrapitops.plan.storage.file.PlanFiles in project Plan by plan-player-analytics.

the class JSONStorageTest method setUp.

@BeforeEach
void setUp(@TempDir Path tempDir) {
    PlanFiles files = Mockito.mock(PlanFiles.class);
    this.tempDir = tempDir;
    when(files.getJSONStorageDirectory()).thenReturn(this.tempDir);
    UNDER_TEST = new JSONFileStorage(files, value -> Long.toString(value), new TestPluginLogger());
}
Also used : PlanFiles(com.djrapitops.plan.storage.file.PlanFiles) BeforeEach(org.junit.jupiter.api.BeforeEach) Files(java.nio.file.Files) IOException(java.io.IOException) Mockito.when(org.mockito.Mockito.when) Collectors(java.util.stream.Collectors) File(java.io.File) Test(org.junit.jupiter.api.Test) TimeUnit(java.util.concurrent.TimeUnit) Mockito(org.mockito.Mockito) List(java.util.List) Stream(java.util.stream.Stream) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) TempDir(org.junit.jupiter.api.io.TempDir) Optional(java.util.Optional) TestPluginLogger(utilities.TestPluginLogger) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Path(java.nio.file.Path) Collections(java.util.Collections) PlanFiles(com.djrapitops.plan.storage.file.PlanFiles) TestPluginLogger(utilities.TestPluginLogger) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

PlanFiles (com.djrapitops.plan.storage.file.PlanFiles)1 File (java.io.File)1 IOException (java.io.IOException)1 Files (java.nio.file.Files)1 Path (java.nio.file.Path)1 Collections (java.util.Collections)1 List (java.util.List)1 Optional (java.util.Optional)1 TimeUnit (java.util.concurrent.TimeUnit)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)1 Assertions.assertFalse (org.junit.jupiter.api.Assertions.assertFalse)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Test (org.junit.jupiter.api.Test)1 TempDir (org.junit.jupiter.api.io.TempDir)1 Mockito (org.mockito.Mockito)1 Mockito.when (org.mockito.Mockito.when)1 TestPluginLogger (utilities.TestPluginLogger)1