ExpressionManager expressionManager = mock(ExpressionManager.class);
String staticSqlText = STATIC_SQL_TEXT;
when(expressionManager.parse(DYNAMIC_SQL_TEXT, muleEvent)).thenReturn(staticSqlText);
QueryTemplateParser queryTemplateParser = mock(QueryTemplateParser.class);
when(queryTemplateParser.parse(staticSqlText)).thenThrow(new QueryTemplateParsingException("Parse error"));
DynamicQueryResolver queryResolver = new DynamicQueryResolver(query, queryTemplateParser, expressionManager);
queryResolver.resolve(null, muleEvent);
}