Commit a74941de authored by Hallvard Trætteberg's avatar Hallvard Trætteberg
Browse files

Use multi-line string

parent 17580cc4
......@@ -24,7 +24,19 @@ public class TodoModuleTest {
mapper.registerModule(new TodoModule());
}
private final static String todoListWithTwoItems = "{\"items\":[{\"text\":\"item1\",\"checked\":false},{\"text\":\"item2\",\"checked\":true}]}";
private final static String todoListWithTwoItems = """
{
"items": [
{
"text": "item1",
"checked": false
},{
"text": "item2",
"checked": true
}
]
}
""".replaceAll("\\s+", "");
@Test
public void testSerializers() {
......@@ -37,7 +49,7 @@ public class TodoModuleTest {
list.addTodoItem(item1);
list.addTodoItem(item2);
try {
assertEquals(todoListWithTwoItems.replaceAll("\\s+", ""), mapper.writeValueAsString(list));
assertEquals(todoListWithTwoItems, mapper.writeValueAsString(list));
} catch (JsonProcessingException e) {
fail();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment