GenericScope throws original checked exception, rather than UndeclaredThrowableException
fixes gh-349
This commit is contained in:
@@ -122,10 +122,19 @@ public class RefreshScopeIntegrationTests {
|
||||
ExampleService.event.getName());
|
||||
}
|
||||
|
||||
public static interface Service {
|
||||
// see gh-349
|
||||
@Test(expected = ServiceException.class)
|
||||
@DirtiesContext
|
||||
public void testCheckedException() throws Exception {
|
||||
this.service.throwsException();
|
||||
}
|
||||
|
||||
public interface Service {
|
||||
|
||||
String getMessage();
|
||||
|
||||
String throwsException() throws ServiceException;
|
||||
|
||||
}
|
||||
|
||||
public static class ExampleService implements Service, InitializingBean,
|
||||
@@ -189,12 +198,19 @@ public class RefreshScopeIntegrationTests {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String throwsException() throws ServiceException {
|
||||
throw new ServiceException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(RefreshScopeRefreshedEvent e) {
|
||||
event = e;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ServiceException extends Exception {}
|
||||
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(TestProperties.class)
|
||||
@EnableAutoConfiguration
|
||||
|
||||
Reference in New Issue
Block a user