Skip to content

Commit 39f1adf

Browse files
committed
test cleanup
1 parent b06bec8 commit 39f1adf

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/test/java/com/fasterxml/jackson/databind/ser/jdk/DateSerializationTest.java

+15-17
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void testDateISO8601_customTZ() throws IOException
131131
mapper.setTimeZone(TimeZone.getTimeZone("GMT+2"));
132132

133133
serialize( mapper, judate(1970, 1, 1, 00, 00, 00, 0, "GMT+2"), "1970-01-01T00:00:00.000+0200");
134-
serialize( mapper, judate(1970, 1, 1, 00, 00, 00, 0, "UTC"), "1970-01-01T02:00:00.000+0200");
134+
serialize( mapper, judate(1970, 1, 1, 00, 00, 00, 0, "UTC"), "1970-01-01T02:00:00.000+0200");
135135
}
136136

137137
/**
@@ -318,20 +318,18 @@ public void testFormatWithoutPattern() throws Exception
318318
String json = mapper.writeValueAsString(new DateAsDefaultBeanWithTimezone(0L));
319319
assertEquals(aposToQuotes("{'date':'1970-01-01X01:00:00'}"), json);
320320
}
321-
322-
323-
324-
private static Date judate(int year, int month, int day, int hour, int minutes, int seconds, int millis, String tz) {
325-
Calendar cal = Calendar.getInstance();
326-
cal.set(year, month-1, day, hour, minutes, seconds);
327-
cal.set(Calendar.MILLISECOND, millis);
328-
cal.setTimeZone(TimeZone.getTimeZone(tz));
329-
330-
return cal.getTime();
331-
}
332-
333-
private void serialize(ObjectMapper mapper, Object date, String expected) throws IOException {
334-
String actual = mapper.writeValueAsString(date);
335-
Assert.assertEquals(quote(expected), actual);
336-
}
321+
322+
private static Date judate(int year, int month, int day, int hour, int minutes, int seconds, int millis, String tz) {
323+
Calendar cal = Calendar.getInstance();
324+
cal.set(year, month-1, day, hour, minutes, seconds);
325+
cal.set(Calendar.MILLISECOND, millis);
326+
cal.setTimeZone(TimeZone.getTimeZone(tz));
327+
328+
return cal.getTime();
329+
}
330+
331+
private void serialize(ObjectMapper mapper, Object date, String expected) throws IOException {
332+
String actual = mapper.writeValueAsString(date);
333+
Assert.assertEquals(quote(expected), actual);
334+
}
337335
}

0 commit comments

Comments
 (0)