-
Notifications
You must be signed in to change notification settings - Fork 0
Changes to support ISO date format while deserializing #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
||
TestDateBean bean3 = new TestDateBean(); | ||
bean3.setDate(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse("2014-04-04T21:23:13.331Z")); | ||
bean3.setItem("abc"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use random strings here too
|
||
TestDateBean bean2 = new TestDateBean(); | ||
bean2.setDate(new Date()); | ||
bean2.setItem("abc"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
randomstring here too
public void mustDeserializeBothISOAndMillisForDate() throws ParseException { | ||
assertNotNull(testDateRepository); | ||
TestDateBean bean1 = new TestDateBean(); | ||
bean1.setDate(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'").parse("2024-03-09T00:10Z")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use current time to generate date instead of hard coded date time values
@@ -75,6 +74,35 @@ public void mustCreateMatchAggregationOperation() { | |||
assertNotNull(result); | |||
} | |||
|
|||
@Test | |||
public void mustDeserializeBothISOAndMillisForDate() throws ParseException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make these into parameterized test. Rather than having multiple scenarios in one test.
bean3.setItem("abc"); | ||
bean3.set_id(UUID.randomUUID().toString()); | ||
|
||
List<TestDateBean> beans = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a negative test?
No description provided.