From 8d46da6199f84063299cade73ce7ff4bb07ea66a Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Fri, 24 Jul 2020 15:54:53 +0200 Subject: [PATCH] Added more logging if there are no HTTP stubs in the attached JAR. Fixes gh-1342 --- .../cloud/contract/stubrunner/StubServer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/StubServer.java b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/StubServer.java index 3c046a6878..3c5b541e8d 100644 --- a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/StubServer.java +++ b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/StubServer.java @@ -53,10 +53,15 @@ class StubServer { } private StubServer stubServer() { + this.httpServerStub.registerMappings(this.mappings); log.info("Started stub server for project [" + this.stubConfiguration.toColonSeparatedDependencyNotation() - + "] on port " + this.httpServerStub.port()); - this.httpServerStub.registerMappings(this.mappings); + + "] on port " + this.httpServerStub.port() + " with [" + + this.mappings.size() + "] mappings"); + if (this.mappings.isEmpty() && getPort() != -1) { + log.warn( + "There are no HTTP mappings registered, if your contracts are not messaging based then something went wrong"); + } return this; }