### Question:
QueryTemplateServiceImpl implements QueryTemplateService { private String processQuery(QueryTemplate template, MatchResult result) throws NoSuchMethodException, ScriptException { String query = replaceVariables(template.getQueryGenerator(), result.getVariables()); query = processQuery(query, template.getName()); return query; }  @Override PlatformQuery getTranslatedQuery(String ontology, String query); @Override List<QueryTemplate> getAllQueryTemplates(); @Override QueryTemplate createQueryTemplate(QueryTemplate queryTemplate); @Override boolean queryTemplateExists(QueryTemplate queryTemplate); @Override QueryTemplate getQueryTemplateById(String id); @Override List<QueryTemplate> getQueryTemplateByCriteria(String name); @Override void updateQueryTemplate(QueryTemplate queryTemplate);  }### Answer:
@Test public void given_AQueryTemplate_When_TheQueryTemplateIsProcessed_Then_TheJavascriptCodeIsInterpreted() throws NoSuchMethodException, ScriptException { String query = "var query = \"db.AssetTestArray2.find({})\";\n" + "\n" + "return query;"; String expectedQuery = "db.AssetTestArray2.find({})"; String templateName = "something"; String returnedQuery = service.processQuery(query, templateName); assertTrue("The query should be interpreted by javascript correctly", expectedQuery.equals(returnedQuery)); }