Skip to content

Commit

Permalink
Fix unit test by setting time zone explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
echeran committed Feb 28, 2024
1 parent 7e07bd9 commit b524cbc
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

import java.util.ArrayList;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.TimeZone;
import org.junit.Test;
import org.unicode.conformance.testtype.messageformat2.MFInputArg;
import org.unicode.conformance.testtype.messageformat2.MFInputArgType;
Expand Down Expand Up @@ -33,7 +35,13 @@ public void testGetFormattedMessage() {
MFInputArg expArg = new MFInputArg();
expArg.name = "exp";
expArg.argType = MFInputArgType.datetime;
expArg.value = new Date(1679971371000L); // March 27, 2023, 7:42:51 PM
GregorianCalendar timeInCalendar
= new GregorianCalendar(2023, 2, 27, 19, 42, 51);
timeInCalendar.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
Date timeAsDate = timeInCalendar.getTime();

expArg.value = timeAsDate; // March 27, 2023, 7:42:51 PM

inputs.add(expArg);
inputJson.inputs = inputs;

Expand Down

0 comments on commit b524cbc

Please sign in to comment.