In this brief article I will describe the problem and solution that I have lately faced. As it is a good practice not to hard-code connection data I have extracted them to external file called connection.properties. I did not expect to receive an error something like $[smtp.host]. I did not know what it can means. Below I have described what it is.
I have setup SMTP connector, like in the screen shot below. When I run my MUnit test for this particular flow, I received an error that my application can’t be build.
The problem I got in the console was as follows:
At first I didn’t know why $[smtp.host] is in square brackets not in curly. I thought that I have made a mistake. That is why I looked into my source code in XML view. There I found that smpt.host is in curly brackets as it should. So what is going on?
It turned out that I did not get a root cause exception message. The toot cause was missing smtp.host property. I needed to created separate property file in src/test/resources and then connect it into my MUnit test suit using Property Placeholder (Configuration). After that, the problem was gone.