|
30 | 30 | import org.junit.jupiter.api.AfterEach; |
31 | 31 | import org.junit.jupiter.api.BeforeEach; |
32 | 32 | import org.junit.jupiter.api.Test; |
33 | | -import org.junit.jupiter.params.Parameter; |
34 | | -import org.junit.jupiter.params.ParameterizedClass; |
35 | | -import org.junit.jupiter.params.provider.EnumSource; |
36 | 33 |
|
37 | 34 | import java.time.Duration; |
38 | 35 | import java.util.Collections; |
39 | 36 | import java.util.HashMap; |
40 | 37 | import java.util.List; |
41 | 38 | import java.util.Map; |
42 | 39 | import java.util.Optional; |
43 | | -import java.util.function.Supplier; |
44 | 40 | import java.util.stream.Collectors; |
45 | 41 | import java.util.stream.StreamSupport; |
46 | 42 |
|
|
55 | 51 | import static org.junit.jupiter.api.Assertions.assertThrows; |
56 | 52 | import static org.junit.jupiter.api.Assertions.assertTrue; |
57 | 53 |
|
58 | | -@ParameterizedClass |
59 | | -@EnumSource(TestGraphSupplier.class) |
60 | | -public class DefaultTinkerpopGraphDatabaseManagerTest { |
| 54 | +abstract class DefaultTinkerpopGraphDatabaseManagerTest { |
| 55 | + |
| 56 | + static class ArangoDBTest extends DefaultTinkerpopGraphDatabaseManagerTest { |
| 57 | + @Override |
| 58 | + Graph graph() { |
| 59 | + return TestGraphSupplier.ARANGODB.get(); |
| 60 | + } |
| 61 | + } |
| 62 | + |
| 63 | + static class Neo4jTest extends DefaultTinkerpopGraphDatabaseManagerTest { |
| 64 | + @Override |
| 65 | + Graph graph() { |
| 66 | + return TestGraphSupplier.NEO4J.get(); |
| 67 | + } |
| 68 | + } |
| 69 | + |
| 70 | + static class TinkerGraphTest extends DefaultTinkerpopGraphDatabaseManagerTest { |
| 71 | + @Override |
| 72 | + Graph graph() { |
| 73 | + return TestGraphSupplier.TINKER_GRAPH.get(); |
| 74 | + } |
| 75 | + } |
61 | 76 |
|
62 | 77 | static final String COLLECTION_NAME = "Person"; |
63 | 78 |
|
64 | 79 | private TinkerpopGraphDatabaseManager entityManager; |
65 | 80 |
|
66 | 81 | private final Faker faker = new Faker(); |
67 | 82 |
|
68 | | - @Parameter |
69 | | - private Supplier<Graph> graphSupplier; |
| 83 | + abstract Graph graph(); |
70 | 84 |
|
71 | 85 | @BeforeEach |
72 | 86 | void setUp() { |
73 | | - this.entityManager = TinkerpopGraphDatabaseManager.of(graphSupplier.get()); |
| 87 | + this.entityManager = TinkerpopGraphDatabaseManager.of(graph()); |
74 | 88 | } |
75 | 89 |
|
76 | 90 | @BeforeEach |
|
0 commit comments