views:

1148

answers:

0

I'm using Spring Web Flow 2.0.7, and just started setting up my unit tests. I've got my flows directory, containing the flow xml files and my messages.properties files on my classpath.

It's loading fine, but it doesn't seem to be automatically picking up the messages.properties file for the flow, and thus my validation unit tests are failing because it can't resolve a message for the given code.

Here's the relevant part of the exception:

org.springframework.context.NoSuchMessageException: No message found under code 'error_alnum_char_count_not_atleast' for locale 'en_US'.

This seems like a fairly common scenario, to use the codes resolved in messages.properties to generate error messages. So...what's the recommended way to load the messages.properties file?