[ 
https://issues.apache.org/jira/browse/CAMEL-15755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17220285#comment-17220285
 ] 

Claus Ibsen commented on CAMEL-15755:
-------------------------------------

You are welcome to dive into the code and see if you can help improve this.

> Spring Boot tests broken when using TestInstance.Lifecycle.PER_CLASS
> --------------------------------------------------------------------
>
>                 Key: CAMEL-15755
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15755
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-spring, camel-test, tests
>    Affects Versions: 3.6.0
>            Reporter: Alex Arana
>            Priority: Minor
>             Fix For: 3.x
>
>
> After upgrading to {{3.6.0}} existing Spring Boot tests in my codebase 
> started to fail. After some investigation I discovered that this is due to my 
> unit tests having a single instance per class as configured using JUnit's 
> {{@TestInstance(TestInstance.Lifecycle.PER_CLASS)}}
> Some changes were introduced in a recent commit that affected the existing 
> behaviour in CamelSpringBootExecutionListener: 
> [https://github.com/apache/camel/commit/efc34ab2b98f3697ebb482cf1645fda6f0794797]
> I have remediated my tests by running the following code in a JUnit 
> BeforeEach method within a base test class:
> {code:java}
> // Kotlin
> @BeforeEach
> fun init() {
>     SpringCamelContext.setNoStart(false)
>     camelContext.start()
> }
> {code}
> I am currently looking for a more permanent solution to this issue that 
> properly supports single instance JUnit5 Test classes.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to