Add testing-no-containers module: WireMock, MockWebServer, @MockitoBean/@MockitoSpyBean (post #43)

This commit is contained in:
Claude
2026-10-08 06:19:52 +00:00
parent f736108067
commit 5851521420
20 changed files with 666 additions and 1 deletions
@@ -0,0 +1,10 @@
Picked up JAVA_TOOL_OPTIONS: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=38339 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
/tmp/mockbean-removed-demo/com/ankurm/testingnc/LegacyMockBeanTest.java:5: error: package org.springframework.boot.test.mock.mockito does not exist
import org.springframework.boot.test.mock.mockito.MockBean;
^
/tmp/mockbean-removed-demo/com/ankurm/testingnc/LegacyMockBeanTest.java:10: error: cannot find symbol
@MockBean
^
symbol: class MockBean
location: class LegacyMockBeanTest
2 errors
@@ -0,0 +1,26 @@
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.924 s <<< FAILURE! -- in com.ankurm.testingnc.QuoteClientWireMockTest
[ERROR] com.ankurm.testingnc.QuoteClientWireMockTest -- Time elapsed: 0.924 s <<< ERROR!
com.github.tomakehurst.wiremock.common.FatalStartupException: Jetty 11 is not present and no suitable HttpServerFactory extension was found. Please ensure that the classpath includes a WireMock extension that provides an HttpServerFactory implementation. See http://wiremock.org/docs/extending-wiremock/ for more information.
at com.github.tomakehurst.wiremock.http.HttpServerFactoryLoader.couldNotFindSuitableServerException(HttpServerFactoryLoader.java:85)
at com.github.tomakehurst.wiremock.http.HttpServerFactoryLoader.pickMostAppropriateFrom(HttpServerFactoryLoader.java:73)
at com.github.tomakehurst.wiremock.http.HttpServerFactoryLoader.load(HttpServerFactoryLoader.java:57)
at com.github.tomakehurst.wiremock.WireMockServer.getHttpServerFactory(WireMockServer.java:89)
at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:72)
at com.github.tomakehurst.wiremock.junit5.WireMockExtension.startServerIfRequired(WireMockExtension.java:233)
at com.github.tomakehurst.wiremock.junit5.WireMockExtension.beforeAll(WireMockExtension.java:300)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
[ERROR] Errors:
[ERROR] QuoteClientWireMockTest ? FatalStartup Jetty 11 is not present and no suitable HttpServerFactory extension was found. Please ensure that the classpath includes a WireMock extension that provides an HttpServerFactory implementation. See http://wiremock.org/docs/extending-wiremock/ for more information.
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.6:test (default-test) on project testing-no-containers:
[ERROR]
[ERROR] See /home/claude/spring-boot-demo/testing-no-containers/target/surefire-reports for the individual test results.
[ERROR] See dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
@@ -0,0 +1,38 @@
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.463 s <<< FAILURE! -- in com.ankurm.testingnc.QuoteClientWireMockTest
[ERROR] com.ankurm.testingnc.QuoteClientWireMockTest -- Time elapsed: 1.463 s <<< ERROR!
java.lang.NoClassDefFoundError: org/eclipse/jetty/io/WriteFlusher$Listener
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:962)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:144)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:776)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:691)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:620)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:578)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
at com.github.tomakehurst.wiremock.jetty12.Jetty12HttpServer.createHttpConnector(Jetty12HttpServer.java:88)
at com.github.tomakehurst.wiremock.jetty.JettyHttpServer.<init>(JettyHttpServer.java:79)
at com.github.tomakehurst.wiremock.jetty12.Jetty12HttpServer.<init>(Jetty12HttpServer.java:74)
at com.github.tomakehurst.wiremock.jetty12.Jetty12HttpServerFactory.buildHttpServer(Jetty12HttpServerFactory.java:33)
at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:75)
at com.github.tomakehurst.wiremock.junit5.WireMockExtension.startServerIfRequired(WireMockExtension.java:233)
at com.github.tomakehurst.wiremock.junit5.WireMockExtension.beforeAll(WireMockExtension.java:300)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.io.WriteFlusher$Listener
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
... 16 more
[ERROR] Errors:
[ERROR] QuoteClientWireMockTest ? NoClassDefFound org/eclipse/jetty/io/WriteFlusher$Listener
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.6:test (default-test) on project testing-no-containers:
[ERROR]
[ERROR] See /home/claude/spring-boot-demo/testing-no-containers/target/surefire-reports for the individual test results.
[ERROR] See dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
@@ -0,0 +1,129 @@
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< com.ankurm:testing-no-containers >------------------
[INFO] Building testing-no-containers 1.0.0
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.5.0:clean (default-clean) @ testing-no-containers ---
[INFO] Deleting /home/claude/spring-boot-demo/testing-no-containers/target
[INFO]
[INFO] --- resources:3.5.0:resources (default-resources) @ testing-no-containers ---
[INFO] Copying 1 resource from src/main/resources to target/classes
[INFO] Copying 0 resource from src/main/resources to target/classes
[INFO]
[INFO] --- compiler:3.15.0:compile (default-compile) @ testing-no-containers ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 5 source files with javac [debug parameters release 25] to target/classes
[INFO]
[INFO] --- resources:3.5.0:testResources (default-testResources) @ testing-no-containers ---
[INFO] Copying 1 resource from src/test/resources to target/test-classes
[INFO]
[INFO] --- compiler:3.15.0:testCompile (default-testCompile) @ testing-no-containers ---
[INFO] Recompiling the module because of changed dependency.
[INFO] Compiling 5 source files with javac [debug parameters release 25] to target/test-classes
[INFO]
[INFO] --- surefire:3.5.6:test (default-test) @ testing-no-containers ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.ankurm.testingnc.GreetingMockitoSpyBeanCTest
11:46:56.481 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.ankurm.testingnc.GreetingMockitoSpyBeanCTest]: GreetingMockitoSpyBeanCTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
11:46:56.753 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration com.ankurm.testingnc.Application for test class com.ankurm.testingnc.GreetingMockitoSpyBeanCTest
11:46:56.879 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.ankurm.testingnc.GreetingMockitoSpyBeanCTest]: GreetingMockitoSpyBeanCTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
11:46:56.886 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration com.ankurm.testingnc.Application for test class com.ankurm.testingnc.GreetingMockitoSpyBeanCTest
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v4.1.1)
2026-10-08T11:46:57.415+05:30 INFO 13524 --- [ main] c.a.t.GreetingMockitoSpyBeanCTest : Starting GreetingMockitoSpyBeanCTest using Java 25.0.4.1.1 with PID 13524 (started by root in /home/claude/spring-boot-demo/testing-no-containers)
2026-10-08T11:46:57.418+05:30 INFO 13524 --- [ main] c.a.t.GreetingMockitoSpyBeanCTest : No active profile set, falling back to 1 default profile: "default"
Mockito is currently self-attaching to enable the inline-mock-maker. This will no longer work in future releases of the JDK. Please add Mockito as an agent to your build as described in Mockito's documentation: https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
2026-10-08T11:47:01.581+05:30 INFO 13524 --- [ main] c.a.t.GreetingMockitoSpyBeanCTest : Started GreetingMockitoSpyBeanCTest in 4.598 seconds (process running for 6.85)
2026-10-08T11:47:01.589+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 0, parentContextCount = 0, hitCount = 0, missCount = 1, failureCount = 0]
2026-10-08T11:47:01.607+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 1, missCount = 1, failureCount = 0]
2026-10-08T11:47:01.611+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 2, missCount = 1, failureCount = 0]
2026-10-08T11:47:01.613+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 3, missCount = 1, failureCount = 0]
2026-10-08T11:47:01.637+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 4, missCount = 1, failureCount = 0]
2026-10-08T11:47:01.638+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 5, missCount = 1, failureCount = 0]
2026-10-08T11:47:01.647+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 6, missCount = 1, failureCount = 0]
2026-10-08T11:47:01.766+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 7, missCount = 1, failureCount = 0]
2026-10-08T11:47:01.768+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 8, missCount = 1, failureCount = 0]
2026-10-08T11:47:01.773+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 9, missCount = 1, failureCount = 0]
2026-10-08T11:47:01.791+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 10, missCount = 1, failureCount = 0]
2026-10-08T11:47:01.792+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 1, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 11, missCount = 1, failureCount = 0]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.679 s -- in com.ankurm.testingnc.GreetingMockitoSpyBeanCTest
[INFO] Running com.ankurm.testingnc.GreetingMockitoBeanBTest
2026-10-08T11:47:01.820+05:30 INFO 13524 --- [ main] t.c.s.AnnotationConfigContextLoaderUtils : Could not detect default configuration classes for test class [com.ankurm.testingnc.GreetingMockitoBeanBTest]: GreetingMockitoBeanBTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
2026-10-08T11:47:01.828+05:30 INFO 13524 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Found @SpringBootConfiguration com.ankurm.testingnc.Application for test class com.ankurm.testingnc.GreetingMockitoBeanBTest
2026-10-08T11:47:01.830+05:30 INFO 13524 --- [ main] t.c.s.AnnotationConfigContextLoaderUtils : Could not detect default configuration classes for test class [com.ankurm.testingnc.GreetingMockitoBeanBTest]: GreetingMockitoBeanBTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
2026-10-08T11:47:01.834+05:30 INFO 13524 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Found @SpringBootConfiguration com.ankurm.testingnc.Application for test class com.ankurm.testingnc.GreetingMockitoBeanBTest
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v4.1.1)
2026-10-08T11:47:01.986+05:30 INFO 13524 --- [ main] c.a.testingnc.GreetingMockitoBeanBTest : Starting GreetingMockitoBeanBTest using Java 25.0.4.1.1 with PID 13524 (started by root in /home/claude/spring-boot-demo/testing-no-containers)
2026-10-08T11:47:01.987+05:30 INFO 13524 --- [ main] c.a.testingnc.GreetingMockitoBeanBTest : No active profile set, falling back to 1 default profile: "default"
2026-10-08T11:47:02.978+05:30 INFO 13524 --- [ main] c.a.testingnc.GreetingMockitoBeanBTest : Started GreetingMockitoBeanBTest in 1.118 seconds (process running for 8.246)
2026-10-08T11:47:02.979+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 0, parentContextCount = 0, hitCount = 11, missCount = 2, failureCount = 0]
2026-10-08T11:47:02.981+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 12, missCount = 2, failureCount = 0]
2026-10-08T11:47:02.981+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 13, missCount = 2, failureCount = 0]
2026-10-08T11:47:02.982+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 14, missCount = 2, failureCount = 0]
2026-10-08T11:47:02.986+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 15, missCount = 2, failureCount = 0]
2026-10-08T11:47:02.988+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 16, missCount = 2, failureCount = 0]
2026-10-08T11:47:02.991+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 17, missCount = 2, failureCount = 0]
2026-10-08T11:47:02.999+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 18, missCount = 2, failureCount = 0]
2026-10-08T11:47:03.000+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 19, missCount = 2, failureCount = 0]
2026-10-08T11:47:03.003+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 20, missCount = 2, failureCount = 0]
2026-10-08T11:47:03.008+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 21, missCount = 2, failureCount = 0]
2026-10-08T11:47:03.009+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 22, missCount = 2, failureCount = 0]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.195 s -- in com.ankurm.testingnc.GreetingMockitoBeanBTest
[INFO] Running com.ankurm.testingnc.QuoteClientMockWebServerTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.729 s -- in com.ankurm.testingnc.QuoteClientMockWebServerTest
[INFO] Running com.ankurm.testingnc.QuoteClientWireMockTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.896 s -- in com.ankurm.testingnc.QuoteClientWireMockTest
[INFO] Running com.ankurm.testingnc.GreetingMockitoBeanATest
2026-10-08T11:47:05.788+05:30 INFO 13524 --- [ main] t.c.s.AnnotationConfigContextLoaderUtils : Could not detect default configuration classes for test class [com.ankurm.testingnc.GreetingMockitoBeanATest]: GreetingMockitoBeanATest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
2026-10-08T11:47:05.797+05:30 INFO 13524 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Found @SpringBootConfiguration com.ankurm.testingnc.Application for test class com.ankurm.testingnc.GreetingMockitoBeanATest
2026-10-08T11:47:05.808+05:30 INFO 13524 --- [ main] t.c.s.AnnotationConfigContextLoaderUtils : Could not detect default configuration classes for test class [com.ankurm.testingnc.GreetingMockitoBeanATest]: GreetingMockitoBeanATest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
2026-10-08T11:47:05.810+05:30 INFO 13524 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Found @SpringBootConfiguration com.ankurm.testingnc.Application for test class com.ankurm.testingnc.GreetingMockitoBeanATest
2026-10-08T11:47:05.813+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 0, parentContextCount = 0, hitCount = 23, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.815+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 24, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.816+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 25, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.817+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 26, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.819+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 27, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.822+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 28, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.822+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 29, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.824+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 30, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.826+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 31, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.827+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 32, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.828+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 33, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.829+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 34, missCount = 2, failureCount = 0]
2026-10-08T11:47:05.831+05:30 DEBUG 13524 --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [DefaultContextCache@778c2e7c size = 2, maxSize = 32, contextUsageCount = 1, parentContextCount = 0, hitCount = 35, missCount = 2, failureCount = 0]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.050 s -- in com.ankurm.testingnc.GreetingMockitoBeanATest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.113 s
[INFO] Finished at: 2026-10-08T11:47:06+05:30
[INFO] ------------------------------------------------------------------------
@@ -0,0 +1,36 @@
[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.831 s <<< FAILURE! -- in com.ankurm.testingnc.QuoteClientMockWebServerTest
[ERROR] com.ankurm.testingnc.QuoteClientMockWebServerTest.truncatedBodyIsNotTheSameAsASeveredConnection -- Time elapsed: 1.564 s <<< FAILURE!
java.lang.AssertionError:
Expecting actual throwable to be an instance of:
org.springframework.web.client.ResourceAccessException
but was:
org.springframework.web.client.RestClientException: Error while extracting response for type [com.ankurm.testingnc.Quote] and content type [application/json]
at org.springframework.web.client.DefaultRestClient.readWithMessageConverters(DefaultRestClient.java:274)
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.readBody(DefaultRestClient.java:931)
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.lambda$body$0(DefaultRestClient.java:833)
...(93 remaining lines not displayed - this can be changed with Assertions.setMaxStackTraceElementsDisplayed)
at com.ankurm.testingnc.QuoteClientMockWebServerTest.truncatedBodyIsNotTheSameAsASeveredConnection(QuoteClientMockWebServerTest.java:55)
[ERROR] Failures:
[ERROR] QuoteClientMockWebServerTest.truncatedBodyIsNotTheSameAsASeveredConnection:55
Expecting actual throwable to be an instance of:
org.springframework.web.client.ResourceAccessException
but was:
org.springframework.web.client.RestClientException: Error while extracting response for type [com.ankurm.testingnc.Quote] and content type [application/json]
at org.springframework.web.client.DefaultRestClient.readWithMessageConverters(DefaultRestClient.java:274)
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.readBody(DefaultRestClient.java:931)
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.lambda$body$0(DefaultRestClient.java:833)
...(93 remaining lines not displayed - this can be changed with Assertions.setMaxStackTraceElementsDisplayed)
[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.6:test (default-test) on project testing-no-containers: There are test failures.
[ERROR]
[ERROR] See /home/claude/spring-boot-demo/testing-no-containers/target/surefire-reports for the individual test results.
[ERROR] See dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException