@Test
public void should_show_the_correct_information_for_variables() throws Exception {

    Path expectedFilePath = Paths.get(getClass().getResource("/page-with-variables/").toURI()).resolve("page-with-variables.json");
    String expectedFileString = String.join("", readAllLines(expectedFilePath));
    Map<String, Variable> variables = new HashMap<>();
    variables.put("constantVar", new Variable(DataType.CONSTANT, "constantVariableValue"));
    variables.put("jsonVar", new Variable(DataType.JSON, "{\"var1\":1, \"var2\":2, \"var3\":\"value3\"}"));
    variables.put("jsVar", new Variable(DataType.EXPRESSION, "var variable = \"hello\"; return variable;"));
    Page page = new Page();
    page.setId("page-with-variables");
    page.setVariables(variables);
    page.setDesignerVersion("1.10.6");
    page.setName("page");
    page.setLastUpdate(new Instant(1514989634397L));
    page.setRows(new ArrayList<>());
    when(pageService.get("id")).thenReturn(page);
    mockMvc.perform(get("/rest/pages/id"))
            .andExpect(status().isOk())
            .andExpect(content().string(expectedFileString));
}