Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
Test failed
Browse files Browse the repository at this point in the history
  • Loading branch information
hirro committed Apr 22, 2014
1 parent 6aac98f commit 5331d7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/main/java/com/arnellconsulting/tps/model/TimeEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import javax.validation.constraints.NotNull;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat;
Expand Down Expand Up @@ -143,12 +144,12 @@ public void serialize(
if (timeEntry.getProject() != null && timeEntry.getProject().getId() != null) {
jsonGenerator.writeNumberField("projectId", timeEntry.getProject().getId());
}
DateTimeFormatter fmt = ISODateTimeFormat.dateHourMinuteSecond();
DateTimeFormatter fmt = ISODateTimeFormat.dateTimeNoMillis();
if (timeEntry.getStartTime() != null) {
jsonGenerator.writeStringField("startTime", fmt.print(timeEntry.getStartTime()));
jsonGenerator.writeStringField("startTime", fmt.print(timeEntry.getStartTime().toDateTime(DateTimeZone.UTC)));
}
if (timeEntry.getEndTime() != null) {
jsonGenerator.writeStringField("endTime", fmt.print(timeEntry.getEndTime()));
jsonGenerator.writeStringField("endTime", fmt.print(timeEntry.getEndTime().toDateTime(DateTimeZone.UTC)));
}
jsonGenerator.writeEndObject();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void testRead() throws Exception {
)
.andExpect(status().isOk())
.andExpect(content().contentType(TestConstants.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("startTime", is("2010-05-21T00:00:00")));
.andExpect(jsonPath("startTime", is("2010-05-20T22:00:00Z")));

verify(tpsServiceMock, times(1)).getTimeEntry(1L);
verifyNoMoreInteractions(tpsServiceMock);
Expand Down

0 comments on commit 5331d7e

Please sign in to comment.