public SimpleMain(CamelContext camelContext) {
        super(camelContext);
    }
@Test
    public void testSimpleMain() throws Exception {
        List<String> events = new ArrayList<>();
        CamelContext context = new DefaultCamelContext();

        SimpleMain main = new SimpleMain(context);
        main.configure().addRoutesBuilder(new MyRouteBuilder());
        main.addMainListener(new MainListenerSupport() {
            @Override
            public void beforeInitialize(BaseMainSupport main) {
                events.add("beforeInitialize");
            }

            @Override
            public void beforeConfigure(BaseMainSupport main) {
                events.add("beforeConfigure");
            }

            @Override
            public void afterConfigure(BaseMainSupport main) {
                events.add("afterConfigure");
            }

            @Override
            public void beforeStart(BaseMainSupport main) {
                events.add("beforeStart");
            }

            @Override
            public void afterStart(BaseMainSupport main) {
                events.add("afterStart");
            }

            @Override
            public void beforeStop(BaseMainSupport main) {
                events.add("beforeStop");
            }

            @Override
            public void afterStop(BaseMainSupport main) {
                events.add("afterStop");
            }

        });
        main.start();

        try {
            assertSame(context, main.getCamelContext());

            MockEndpoint endpoint = context.getEndpoint("mock:results", MockEndpoint.class);
            endpoint.expectedMinimumMessageCount(1);

            context.createProducerTemplate().sendBody("direct:start", "<message>1</message>");

            endpoint.assertIsSatisfied();
        } finally {
            main.stop();
        }

        assertTrue(events.contains("beforeInitialize"));
        assertTrue(events.contains("beforeConfigure"));
        assertTrue(events.contains("afterConfigure"));
        assertTrue(events.contains("beforeStart"));
        assertTrue(events.contains("afterStart"));
        assertTrue(events.contains("beforeStop"));
        assertTrue(events.contains("afterStop"));
    }