Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
slf4jVersion = "2.0.17"
junitVersion = "4.13.2"
junitBomVersion = "5.13.4"
junitBomVersion = "6.0.0"
equalsVerifierVersion = "4.1.1"
purefunVersion = "5.1"
purejsonVersion = "1.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,23 @@ private List<Tuple2<Field, Mount>> findServices(ExtensionContext extensionContex
}

private HttpServer createMockServer(ExtensionContext context) {
return getStore(context).getOrComputeIfAbsent(SERVER, key -> buildMockServer(context), HttpServer.class);
return getStore(context).computeIfAbsent(SERVER, key -> buildMockServer(context), HttpServer.class);
}

private HttpServer getMockServer(ExtensionContext context) {
return getStore(context).get(SERVER, HttpServer.class);
var httpServer = getStore(context).get(SERVER, HttpServer.class);
if (httpServer == null) {
throw new IllegalStateException();
}
return httpServer;
}

private HttpServer removeMockServer(ExtensionContext context) {
return getStore(context).remove(SERVER, HttpServer.class);
var httpServer = getStore(context).remove(SERVER, HttpServer.class);
if (httpServer == null) {
throw new IllegalStateException();
}
return httpServer;
}

private Store getStore(ExtensionContext context) {
Expand Down