Skip to content
Snippets Groups Projects
Commit a74941de authored by Hallvard Trætteberg's avatar Hallvard Trætteberg
Browse files

Use multi-line string

parent 17580cc4
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,19 @@ public class TodoModuleTest { ...@@ -24,7 +24,19 @@ public class TodoModuleTest {
mapper.registerModule(new TodoModule()); 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 @Test
public void testSerializers() { public void testSerializers() {
...@@ -37,7 +49,7 @@ public class TodoModuleTest { ...@@ -37,7 +49,7 @@ public class TodoModuleTest {
list.addTodoItem(item1); list.addTodoItem(item1);
list.addTodoItem(item2); list.addTodoItem(item2);
try { try {
assertEquals(todoListWithTwoItems.replaceAll("\\s+", ""), mapper.writeValueAsString(list)); assertEquals(todoListWithTwoItems, mapper.writeValueAsString(list));
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
fail(); fail();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment