Skip to content
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

Return a UTC ZonedDateTime from CargoRoutingDTO::getArrivalDeadline #147

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import java.io.Serializable;
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.temporal.Temporal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -67,8 +70,7 @@ public boolean isRouted() {
return !legs.isEmpty();
}

public Instant getArrivalDeadline() {
return arrivalDeadline;
public ZonedDateTime getArrivalDeadline() {
return arrivalDeadline.atZone(ZoneOffset.UTC);
}

}
2 changes: 1 addition & 1 deletion src/main/resources/templates/admin/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</tr>
<tr>
<td>Arrival deadline</td>
<td th:text="${#dates.format(cargo.arrivalDeadline,'dd/MM/yyyy')}"/>
<td th:text="${#temporals.format(cargo.arrivalDeadline,'dd/MM/yyyy')}"/>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public CargoDestinationPage changeDestination() {
public void expectArrivalDeadlineOf(LocalDate expectedArrivalDeadline) {
String actualArrivalDeadline = driver.findElement(By.xpath("//div[@id='container']/table/tbody/tr[4]/td[2]")).getText();

assertThat(expectedArrivalDeadline.format(FORMATTER)).isEqualTo(actualArrivalDeadline);
assertThat(actualArrivalDeadline).isEqualTo(expectedArrivalDeadline.format(FORMATTER));
}

public void expectRoutedOf(String routingStatus) {
Expand Down
Loading