@@ -0,0 +1,2854 @@
+package com.payu.ratel.tests;%0A%0Aimport static com.jayway.awaitility.Awaitility.await;%0Aimport static com.payu.ratel.config.beans.RegistryBeanProviderFactory.SERVICE_DISCOVERY_ADDRESS;%0Aimport static com.payu.ratel.config.beans.ServiceRegisterPostProcessorFactory.JBOSS_BIND_ADDRESS;%0Aimport static com.payu.ratel.config.beans.ServiceRegisterPostProcessorFactory.JBOSS_BIND_PORT;%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.SpringApplication;%0Aimport org.springframework.boot.test.IntegrationTest;%0Aimport org.springframework.boot.test.SpringApplicationConfiguration;%0Aimport org.springframework.context.ConfigurableApplicationContext;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.test.context.web.WebAppConfiguration;%0A%0Aimport com.payu.ratel.Discover;%0Aimport com.payu.ratel.config.EnableServiceDiscovery;%0Aimport com.payu.ratel.config.ServiceDiscoveryConfig;%0Aimport com.payu.ratel.server.DiscoveryServerMain;%0Aimport com.payu.ratel.server.InMemoryDiscoveryServer;%0Aimport com.payu.ratel.tests.service.MyException;%0Aimport com.payu.ratel.tests.service.TestService;%0Aimport com.payu.ratel.tests.service.TestServiceConfiguration;%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@SpringApplicationConfiguration(classes = %7BServiceDiscoveryConfig.class, DiscoveryServerMain.class%7D)%0A@IntegrationTest(%7B%0A        %22server.port:8065%22,%0A        SERVICE_DISCOVERY_ADDRESS + %22:http://localhost:8065/server/discovery%22%7D)%0A@WebAppConfiguration%0A@EnableServiceDiscovery%0Apublic class ExceptionTransportTest %7B%0A%0A    private ConfigurableApplicationContext remoteContext;%0A%0A    @Autowired%0A    private InMemoryDiscoveryServer server;%0A%0A    @Discover%0A    private TestService testService;%0A%0A    @Before%0A    public void before() throws InterruptedException %7B%0A        remoteContext = SpringApplication.run(TestServiceConfiguration.class,%0A                %22--server.port=8031%22,%0A                %22--%22 + JBOSS_BIND_ADDRESS + %22=localhost%22,%0A                %22--%22 + JBOSS_BIND_PORT + %22=8031%22,%0A                %22--spring.jmx.enabled=false%22,%0A                %22--%22 + SERVICE_DISCOVERY_ADDRESS + %22=http://localhost:8065/server/discovery%22);%0A    %7D%0A%0A    @After%0A    public void close() %7B%0A        remoteContext.close();%0A    %7D%0A%0A    @Test(expected=MyException.class)%0A    public void shouldNotThrowException() throws InterruptedException %7B%0A        await().atMost(10, TimeUnit.SECONDS).until(new Runnable() %7B%0A%0A%09%09%09@Override%0A%09%09%09public void run() %7B%0A%09%09%09%09assertThat(server.fetchAllServices()).hasSize(1);%0A%09%09%09%7D%0A        %09%0A        %7D);%0A%0A        //when%0A        testService.throwsException();%0A%0A        //then%0A        //nothing%0A    %7D%0A%0A%7D%0A

Test case for incorrectly transported exceptions