List of usage examples for org.springframework.context NoSuchMessageException getCause
public synchronized Throwable getCause()
From source file:org.synyx.sample.ResourceBundleMessageSourceTest.java
@Test public void test_resource_bundle_msg_source_broken() throws Exception { try {/*from w w w. ja va2s . c om*/ ResourceBundleMessageSource bundle = new ResourceBundleMessageSource(); bundle.setBasename("broken_messages"); bundle.getMessage("test.1", new Object[0], Locale.getDefault()); fail("Should throw Exception due to wrong format of file"); } catch (NoSuchMessageException e) { // SHOULD have a cause to indicate why the message is missing assertNotNull(e.getCause()); } }