Optimize and refactor (#2302)
This commit is contained in:
committed by
GitHub
parent
4e95722017
commit
f8bf4038f1
+4
-4
@@ -21,10 +21,10 @@ public class JsonCreatorUnitTest {
|
||||
|
||||
// arrange
|
||||
String authorJson =
|
||||
"{" +
|
||||
" \"christianName\": \"Alex\"," +
|
||||
" \"surname\": \"Theedom\"" +
|
||||
"}";
|
||||
"{" +
|
||||
" \"christianName\": \"Alex\"," +
|
||||
" \"surname\": \"Theedom\"" +
|
||||
"}";
|
||||
|
||||
// act
|
||||
final Author author = new ObjectMapper().readerFor(Author.class).readValue(authorJson);
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ public class JsonFilterUnitTest {
|
||||
// arrange
|
||||
Author author = new Author("Alex", "Theedom");
|
||||
FilterProvider filters = new SimpleFilterProvider()
|
||||
.addFilter("authorFilter", SimpleBeanPropertyFilter.filterOutAllExcept("lastName"));
|
||||
.addFilter("authorFilter", SimpleBeanPropertyFilter.filterOutAllExcept("lastName"));
|
||||
|
||||
// act
|
||||
String result = new ObjectMapper().writer(filters).writeValueAsString(author);
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@ public class JsonFormatUnitTest {
|
||||
Date date = df.parse(toParse);
|
||||
|
||||
Book book = new Book(
|
||||
"Design Patterns: Elements of Reusable Object-oriented Software",
|
||||
new Author("The", "GoF")
|
||||
"Design Patterns: Elements of Reusable Object-oriented Software",
|
||||
new Author("The", "GoF")
|
||||
);
|
||||
book.setPublished(date);
|
||||
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ public class JsonPropertyUnitTest {
|
||||
|
||||
// arrange
|
||||
Book book = new Book(
|
||||
"Design Patterns: Elements of Reusable Object-oriented Software",
|
||||
new Author("The", "GoF")
|
||||
"Design Patterns: Elements of Reusable Object-oriented Software",
|
||||
new Author("The", "GoF")
|
||||
);
|
||||
book.configureBinding("Hardback");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user