Mockito.when(req.getParameter("license_type")).thenReturn("trial");
Mockito.when(req.getParameter("license_level")).thenReturn("400");
final StringBuilder reqcode=new StringBuilder();
Mockito.doAnswer(new Answer() {
public Object answer(com.dotcms.repackage.org.mockito.invocation.InvocationOnMock invocation) throws Throwable {
reqcode.append(invocation.getArguments()[1].toString());
return null;
}
}).when(req).setAttribute(Mockito.eq("requestCode"),Mockito.any(String.class));