Java 11 migrate remaining e (#1112)
* Moves eip-aggregator to Java 11 * Moves eip-message-channel to Java 11 * Moves eip-publish-subscribe to Java 11 * Moves eip-splitter to Java 11 * Moves eip-wire-tap to Java 11 * Moves event-aggregator to Java 11 * Moves event-asynchronous to Java 11 * Moves event-driven-architecture to Java 11 * Moves event-queue to Java 11 * Moves event-sourcing to Java 11 * Moves execute-around to Java 11 * Moves extension-objects to Java 11
This commit is contained in:
committed by
Ilkka Seppälä
parent
b09b100614
commit
fb2c026822
@ -27,7 +27,6 @@ import org.apache.camel.CamelContext;
|
||||
import org.apache.camel.builder.RouteBuilder;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
||||
/**
|
||||
* It is very common in integration systems that incoming messages consists of many items bundled
|
||||
@ -53,10 +52,10 @@ public class App {
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
// Run Spring Boot application and obtain ApplicationContext
|
||||
ConfigurableApplicationContext context = SpringApplication.run(App.class, args);
|
||||
var context = SpringApplication.run(App.class, args);
|
||||
|
||||
// Get CamelContext from ApplicationContext
|
||||
CamelContext camelContext = (CamelContext) context.getBean("camelContext");
|
||||
var camelContext = (CamelContext) context.getBean("camelContext");
|
||||
|
||||
// Add a new routes that will handle endpoints form SplitterRoute class.
|
||||
camelContext.addRoutes(new RouteBuilder() {
|
||||
|
@ -32,7 +32,6 @@ public class AppTest {
|
||||
|
||||
@Test
|
||||
public void testMain() throws Exception {
|
||||
String[] args = {};
|
||||
App.main(args);
|
||||
App.main(new String[]{});
|
||||
}
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
/**
|
||||
* Test class for <i>SplitterRoute</i>.
|
||||
* <p>
|
||||
* In order for it to work we have to mock endpoints we want to read/write to. To mock those we need to substitute
|
||||
* original endpoint names to mocks.
|
||||
* In order for it to work we have to mock endpoints we want to read/write to. To mock those we need
|
||||
* to substitute original endpoint names to mocks.
|
||||
* </p>
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@ -57,6 +57,7 @@ public class SplitterRouteTest {
|
||||
|
||||
/**
|
||||
* Test if endpoint receives three separate messages.
|
||||
*
|
||||
* @throws Exception in case of en exception during the test
|
||||
*/
|
||||
@Test
|
||||
@ -64,7 +65,7 @@ public class SplitterRouteTest {
|
||||
public void testSplitter() throws Exception {
|
||||
|
||||
// Three items in one entry message
|
||||
entry.sendBody(new String[] {"TEST1", "TEST2", "TEST3"});
|
||||
entry.sendBody(new String[]{"TEST1", "TEST2", "TEST3"});
|
||||
|
||||
// Endpoint should have three different messages in the end order of the messages is not important
|
||||
endpoint.expectedMessageCount(3);
|
||||
|
Reference in New Issue
Block a user