1 package de.juplo.kafka.chat.backend;
3 import lombok.extern.slf4j.Slf4j;
4 import org.junit.jupiter.api.BeforeEach;
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.test.context.TestPropertySource;
8 import java.io.IOException;
9 import java.nio.file.Files;
10 import java.nio.file.Path;
11 import java.nio.file.Paths;
14 @TestPropertySource(properties = {
15 "chat.backend.inmemory.sharding-strategy=none",
16 "chat.backend.inmemory.storage-strategy=files",
17 "chat.backend.inmemory.storage-directory=target/files" })
19 public class InMemoryWithFilesStorageIT extends AbstractInMemoryStorageIT
23 @Autowired ChatBackendProperties properties)
26 Path path = Paths.get(properties.getInmemory().getStorageDirectory());
27 if (Files.exists(path))
35 if (!file.equals(path))
37 log.debug("Deleting file {}", file);
43 throw new RuntimeException(e);
46 log.debug("Deleting data-directory {}", path);