Reputation: 23
When setting environment for integration tests I get StackOverflowException:
14:58:19.614 [Test worker] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.ametras.vision.backend.restcontroller.MyTest], using SpringBootContextLoader
14:58:19.625 [Test worker] INFO o.s.t.c.s.AbstractContextLoader - Could not detect default resource locations for test class [com.ametras.vision.backend.restcontroller.MyTest]: no resource found for suffixes {-context.xml, Context.groovy}.
14:58:19.626 [Test worker] INFO o.s.t.c.s.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [com.ametras.vision.backend.restcontroller.MyTest]: MyTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
14:58:19.801 [Test worker] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration com.ametras.vision.backend.Application for test class com.ametras.vision.backend.restcontroller.MyTest
14:58:19.916 [Test worker] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]
14:58:19.938 [Test worker] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@2dbd803f, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@3e48e859, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@31ddd4a4, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@1a5f7e7c, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@5b22b970, org.springframework.test.context.support.DirtiesContextTestExecutionListener@22d1886d, org.springframework.test.context.transaction.TransactionalTestExecutionListener@7df60067, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@1cbb3d3b, org.springframework.test.context.event.EventPublishingTestExecutionListener@529cfee5, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@7ca0863b, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@319854f0, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@748fe51d, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@415156bf, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@393881f0, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@4af46df3]
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.5.1)
14:58:20.348 [Test worker] INFO c.a.v.backend.restcontroller.MyTest - Starting MyTest using Java 11.0.21 on LAPTOP-AL12DJ1Q with PID 23152 (started by Kamila Musialkowska in C:\Users\Kamila Musialkowska\IdeaProjects\workflow-manager\Backend)
14:58:20.349 [Test worker] DEBUG c.a.v.backend.restcontroller.MyTest - Running with Spring Boot v2.5.1, Spring v5.3.8
14:58:20.351 [Test worker] INFO c.a.v.backend.restcontroller.MyTest - No active profile set, falling back to default profiles: default
14:58:20.384 [background-preinit] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 6.2.0.Final
14:58:21.138 [Test worker] INFO org.eclipse.jetty.util.log - Logging initialized @3307ms to org.eclipse.jetty.util.log.Slf4jLog
14:58:21.950 [Test worker] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
14:58:21.979 [Test worker] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 14 ms. Found 0 JPA repository interfaces.
14:58:22.765 [Test worker] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@376498da' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
14:58:22.799 [Test worker] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
14:58:23.032 [Test worker] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
14:58:23.167 [Test worker] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
14:58:23.367 [Test worker] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default]
14:58:23.524 [Test worker] INFO org.hibernate.Version - HHH000412: Hibernate ORM core version 5.4.32.Final
14:58:23.824 [Test worker] INFO o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
14:58:24.000 [Test worker] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MariaDBDialect
14:58:24.050 [Test worker] WARN o.hibernate.engine.jdbc.spi.TypeInfo - HHH000273: Error accessing type info result set : java.sql.SQLDataException: integer overflow
14:58:24.061 [Test worker] WARN o.hibernate.engine.jdbc.spi.TypeInfo - HHH000273: Error accessing type info result set : java.sql.SQLDataException: integer overflow
14:58:24.379 [Test worker] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
14:58:24.392 [Test worker] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
14:58:24.620 [Test worker] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
14:58:24.718 [Test worker] INFO c.a.v.b.r.UsermanagementFrontendWidgetRestController - using usermanagementURL: http://cab.com/usermanagement
14:58:26.514 [Test worker] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@30cb489a, org.springframework.security.web.context.SecurityContextPersistenceFilter@25511895, org.springframework.security.web.header.HeaderWriterFilter@e638553, org.springframework.web.filter.CorsFilter@401d83ce, org.springframework.security.web.authentication.logout.LogoutFilter@9ba167e, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@755a90a6, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@7c919e1e, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@3b7b099b, org.springframework.security.web.session.SessionManagementFilter@52bcfd10, org.springframework.security.web.access.ExceptionTranslationFilter@4505015b, org.springframework.security.web.access.intercept.AuthorizationFilter@4844e24b]
14:58:27.199 [Test worker] WARN o.s.b.a.t.ThymeleafAutoConfiguration$DefaultTemplateResolverConfiguration - Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
14:58:27.637 [Test worker] WARN o.m.jdbc.message.server.ErrorPacket - Error: 1050-42S01: Table 'SPRING_SESSION' already exists
14:58:27.655 [Test worker] WARN o.m.jdbc.message.server.ErrorPacket - Error: 1061-42000: Duplicate key name 'SPRING_SESSION_IX1'
14:58:27.672 [Test worker] WARN o.m.jdbc.message.server.ErrorPacket - Error: 1061-42000: Duplicate key name 'SPRING_SESSION_IX2'
14:58:27.690 [Test worker] WARN o.m.jdbc.message.server.ErrorPacket - Error: 1061-42000: Duplicate key name 'SPRING_SESSION_IX3'
14:58:27.694 [Test worker] WARN o.m.jdbc.message.server.ErrorPacket - Error: 1050-42S01: Table 'SPRING_SESSION_ATTRIBUTES' already exists
14:58:28.760 [Test worker] INFO o.s.s.a.ScheduledAnnotationBeanPostProcessor - No TaskScheduler/ScheduledExecutorService bean found for scheduled processing
14:58:28.777 [Test worker] INFO c.a.v.backend.restcontroller.MyTest - Started MyTest in 8.794 seconds (JVM running for 10.946)
14:58:28.788 [Test worker] INFO c.a.v.backend.Application - Server running on null:8080
java.lang.StackOverflowError
at java.base/java.lang.StackTraceElement.of(StackTraceElement.java:526)
at java.base/java.lang.Throwable.getOurStackTrace(Throwable.java:828)
at java.base/java.lang.Throwable.getStackTrace(Throwable.java:820)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:55)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
The test is very basic as it is just environment setting:
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class TestRestControllerIntTest {
@Test
void test() {
assert true;
}
}
However when running application there is no problem:
"C:\Users\Kamila Musialkowska\.jdks\corretto-11.0.23\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2023.3.8\lib\idea_rt.jar=50270:C:\Program Files\JetBrains\IntelliJ IDEA 2023.3.8\bin" -Dfile.encoding=UTF-8 "@C:\Users\KAMILAM~1\AppData\Local\Temp\idea_arg_file459091405" com.ametras.vision.backend.Application
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.5.1)
15:13:57.856 [main] INFO c.a.vision.backend.Application - Starting Application using Java 11.0.23 on LAPTOP-AL12DJ1Q with PID 25076 (C:\Users\Kamila Musialkowska\IdeaProjects\workflow-manager\Backend\build\classes\java\main started by Kamila Musialkowska in C:\Users\Kamila Musialkowska\IdeaProjects\workflow-manager)
15:13:57.856 [background-preinit] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 6.2.0.Final
15:13:57.859 [main] INFO c.a.vision.backend.Application - No active profile set, falling back to default profiles: default
15:13:58.902 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
15:13:58.916 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 7 ms. Found 0 JPA repository interfaces.
15:13:59.342 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@69d103f0' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
15:13:59.347 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
15:13:59.617 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http)
15:13:59.627 [main] INFO o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"]
15:13:59.627 [main] INFO o.a.catalina.core.StandardService - Starting service [Tomcat]
15:13:59.627 [main] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.46]
15:13:59.756 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
15:13:59.756 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 1850 ms
15:13:59.766 [main] INFO c.a.v.b.r.UsermanagementFrontendWidgetRestController - using usermanagementURL: http://cab.com/usermanagement
15:13:59.885 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
15:13:59.927 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
15:13:59.990 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
15:14:00.055 [main] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default]
15:14:00.138 [main] INFO org.hibernate.Version - HHH000412: Hibernate ORM core version 5.4.32.Final
15:14:00.297 [main] INFO o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
15:14:00.408 [main] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MariaDBDialect
15:14:00.435 [main] WARN o.hibernate.engine.jdbc.spi.TypeInfo - HHH000273: Error accessing type info result set : java.sql.SQLDataException: integer overflow
15:14:00.440 [main] WARN o.hibernate.engine.jdbc.spi.TypeInfo - HHH000273: Error accessing type info result set : java.sql.SQLDataException: integer overflow
15:14:00.614 [main] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
15:14:00.625 [main] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
15:14:01.337 [main] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@25b402ea, org.springframework.security.web.context.SecurityContextPersistenceFilter@71f437d7, org.springframework.security.web.header.HeaderWriterFilter@4ac77269, org.springframework.web.filter.CorsFilter@2fccd98f, org.springframework.security.web.authentication.logout.LogoutFilter@4b86a656, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@20e41f13, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@336e17be, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@309e7215, org.springframework.security.web.session.SessionManagementFilter@5464aeec, org.springframework.security.web.access.ExceptionTranslationFilter@528a16fb, org.springframework.security.web.access.intercept.AuthorizationFilter@7b24d5e4]
15:14:01.551 [main] WARN o.s.b.a.t.ThymeleafAutoConfiguration$DefaultTemplateResolverConfiguration - Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
15:14:01.665 [main] WARN o.m.jdbc.message.server.ErrorPacket - Error: 1050-42S01: Table 'SPRING_SESSION' already exists
15:14:01.684 [main] WARN o.m.jdbc.message.server.ErrorPacket - Error: 1061-42000: Duplicate key name 'SPRING_SESSION_IX1'
15:14:01.701 [main] WARN o.m.jdbc.message.server.ErrorPacket - Error: 1061-42000: Duplicate key name 'SPRING_SESSION_IX2'
15:14:01.720 [main] WARN o.m.jdbc.message.server.ErrorPacket - Error: 1061-42000: Duplicate key name 'SPRING_SESSION_IX3'
15:14:01.722 [main] WARN o.m.jdbc.message.server.ErrorPacket - Error: 1050-42S01: Table 'SPRING_SESSION_ATTRIBUTES' already exists
15:14:01.819 [main] INFO o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8080"]
15:14:01.851 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path ''
15:14:02.330 [main] INFO o.s.s.a.ScheduledAnnotationBeanPostProcessor - No TaskScheduler/ScheduledExecutorService bean found for scheduled processing
15:14:02.342 [main] INFO c.a.vision.backend.Application - Started Application in 4.869 seconds (JVM running for 6.467)
15:14:02.347 [main] INFO c.a.vision.backend.Application - Server running on null:8080
Because the application runs normally I ruled out circular dependencies, but I don't know if I'm right on that assumption.
Do you have any idea what can be the problem?
Upvotes: 0
Views: 31