GenericScope throws original checked exception, rather than UndeclaredThrowableException

fixes gh-349
This commit is contained in:
Spencer Gibb
2018-04-02 12:29:22 -04:00
parent 713d6a8d73
commit 78b11c35ff
2 changed files with 22 additions and 1 deletions

View File

@@ -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