Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AnushaKasa
Copy link
Owner

No description provided.


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");

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");

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"));

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 {

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<>();

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants