Hello,
The code for one of the tests that broke is copied below.
The failure is at
require(camelContext.hasEndpoint(PROBE_START) != null, PROBE_START)
So it appears that FFProbeRouteTestConfig is not getting injected into the
context correctly/at the right time anymore. Works ok when I lock to the Feb
snapshot.
There is another test with a similar setup that fails.
And the app proper starts up ok, but some routes are not found/started.
Thanks again,
Steven
@RunWith(classOf[SpringJUnit4ClassRunner])
@SpringApplicationConfiguration(classes =
Array(classOf[FFProbeRouteTestConfig], classOf[TestApp]))
@IntegrationTest(Array("camel.springboot.jmxEnabled=false"))
@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
@Configuration
class FFProbeRouteTest extends JUnitSuite with TryValues with MockitoSugar
with StrictLogging {
import FFProbeRouteTest._
@Autowired var camelContext: CamelContext = _
@Autowired var template: ProducerTemplate = _
@Test def testFfProbe() {
require(camelContext != null, "camelContext")
require(template != null, "template")
require(camelContext.hasEndpoint(PROBE_START) != null, PROBE_START)
require(camelContext.hasEndpoint(PROBE_RESULT) != null, PROBE_RESULT)
val result = camelContext.getEndpoint(PROBE_RESULT,
classOf[MockEndpoint])
result.setExpectedMessageCount(1)
val path = "~/MR-assets0/DEV/unittest.mp4".toPath
template.sendBody(PROBE_START, path)
MockEndpoint.assertIsSatisfied(camelContext)
result.getExchanges.asScala.toList.last.getIn.getMandatoryBody(classOf[FFProbeInfo])
}
}
object FFProbeRouteTest {
val PROBE_START = "direct:probeStart"
val PROBE_RESULT = "mock:probeResult"
}
@Configuration
class FFProbeRouteTestConfig {
import FFProbeRouteTest._
@Bean def ffprobeRouteTest(service: FFProbeService, ef: ExchangeFormatter)
= new RouteBuilder() {
override def configure(): Unit = {
from(PROBE_START).
routeId("test_probe").
process(SyncRoutesConfiguration.probeProcessor(service, ef)).
to("log:ffprobeRouteTest?level=INFO&showAll=true&multiline=true").
to(PROBE_RESULT)
}
}
}
--
View this message in context:
http://camel.465427.n5.nabble.com/Latest-2-15-snapshot-breaks-my-unit-tests-tp5763432p5763526.html
Sent from the Camel - Users mailing list archive at Nabble.com.