Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ole Hermann Bakka
todo-list-example
Commits
a74941de
Commit
a74941de
authored
Oct 14, 2020
by
Hallvard Trætteberg
Browse files
Use multi-line string
parent
17580cc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
todolist/core/src/test/java/todolist/json/TodoModuleTest.java
View file @
a74941de
...
...
@@ -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
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment