4

I have such problem. I'm writing integration tests for my app. In the app I send some mails for the users. When I create email I use Velocity templates. Example of template:

Hi ${user}!

Example of mail:

Hi User!

When I write my integration tests I want to parse parameters from received emails. If I have velocity template and mail which was created with using of this template. I want such method

Map<String,String> getParameters(velocityTemplate, mailBody);

How I can parse parameters from emails text?

Nazar
  • 591
  • 2
  • 8
  • 17

1 Answers1

1

If your question is like Velocity (VM) template request parameters: Getting GET variables then the answer is:

$httpUtil.getParameterMap($httpUtil.getQueryString($request.attributes.CURRENT_URL))

or, as it turns out:

$request.getParameterMap($request.getQueryString($request.attributes.CURRENT_URL))
Community
  • 1
  • 1
Cees Timmerman
  • 17,623
  • 11
  • 91
  • 124