Skip to content

Commit 4400bcb

Browse files
committed
fixed bug with history and other argument provider
1 parent 6e4eb3f commit 4400bcb

File tree

3 files changed

+8
-32
lines changed

3 files changed

+8
-32
lines changed

graphql-database-manager-test/pom.xml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -92,28 +92,4 @@
9292
<version>2.5.4</version>
9393
</dependency>
9494
</dependencies>
95-
96-
<build>
97-
<plugins>
98-
<plugin>
99-
<groupId>org.apache.maven.plugins</groupId>
100-
<artifactId>maven-dependency-plugin</artifactId>
101-
<version>3.8.1</version>
102-
<executions>
103-
<execution>
104-
<id>copy</id>
105-
<phase>test-compile</phase>
106-
<goals>
107-
<goal>copy-dependencies</goal>
108-
</goals>
109-
<configuration>
110-
<includeScope>test</includeScope>
111-
<includeTypes>so,dll,dylib</includeTypes>
112-
<outputDirectory>${project.basedir}/native-libs</outputDirectory>
113-
</configuration>
114-
</execution>
115-
</executions>
116-
</plugin>
117-
</plugins>
118-
</build>
11995
</project>

graphql-database-manager-test/src/main/java/com/phocassoftware/graphql/database/manager/test/ArgumentProvider.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,12 @@ private Tables getTables(boolean scope) {
101101
tableDeleteConsumer.accept(historyTable);
102102
}
103103
}
104-
} else if (scope) {
104+
} else if (scope || withHistory) {
105105
tables = new String[] { "table" + "_" + uniqueId };
106106
historyTable = tables[0] + "_history";
107107
createTable(client, tables[0]);
108-
if (withHistory) {
109-
createHistoryTable(client, historyTable);
110-
tableDeleteConsumer.accept(historyTable);
111-
}
108+
createHistoryTable(client, historyTable);
109+
tableDeleteConsumer.accept(historyTable);
112110
}
113111
return new Tables(tables, historyTable);
114112
} catch (Exception e) {

graphql-database-manager-test/src/main/java/com/phocassoftware/graphql/database/manager/test/TestDatabaseProvider.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public boolean supportsParameter(ParameterContext parameterContext, ExtensionCon
6161
var testDatabase = getTestDatabase(testMethod);
6262

6363
if (testDatabase != null) {
64-
Stream
64+
return Stream
6565
.of(testDatabase.providers())
6666
.map(t -> create(t))
6767
.anyMatch(provider -> parameterContext.getParameter().getType().isAssignableFrom(provider.type()));
@@ -131,7 +131,10 @@ public void beforeEach(ExtensionContext extensionContext) throws Exception {
131131
.map(t -> create(t))
132132
.filter(p -> type.isAssignableFrom(p.type()))
133133
.findAny()
134-
.orElseThrow();
134+
.orElse(null);
135+
if (builder == null) {
136+
return null;
137+
}
135138
return builder.create(provider);
136139

137140
}
@@ -167,7 +170,6 @@ private ServerWrapper getServer() throws Exception {
167170
final var streamClient = startDynamoStreamClient(port);
168171

169172
createTable(client, "table");
170-
createHistoryTable(client, "table_history");
171173
serverWrapper = new ServerWrapper(client, clientAsync, streamClient);
172174
}
173175

0 commit comments

Comments
 (0)