File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/test/java/com/datastax/cdm/cql/codec Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 22
22
import org .junit .jupiter .api .Test ;
23
23
import java .nio .ByteBuffer ;
24
24
import java .text .ParseException ;
25
- import java .time .Instant ;
26
25
import java .time .ZoneOffset ;
27
26
import java .time .ZonedDateTime ;
28
27
import java .time .format .DateTimeFormatter ;
28
+ import java .time .format .DateTimeFormatterBuilder ;
29
29
import java .time .temporal .ChronoUnit ;
30
30
31
31
import static org .junit .jupiter .api .Assertions .*;
@@ -108,10 +108,12 @@ void format_ShouldFormatDateRangeToString() throws ParseException {
108
108
109
109
@ Test
110
110
void parse_ShouldParseStringToDateRange () throws ParseException {
111
+ DateTimeFormatter df = (new DateTimeFormatterBuilder ())
112
+ .appendInstant (3 ).toFormatter ();
111
113
String formattedDateTime = ZonedDateTime .now ()
112
114
.withZoneSameInstant (ZoneOffset .UTC )
113
115
.truncatedTo (ChronoUnit .MILLIS )
114
- .format (DateTimeFormatter . ISO_OFFSET_DATE_TIME );
116
+ .format (df );
115
117
116
118
// Enclose in single quotes as per the error message
117
119
String dateRangeLiteral = "'" + formattedDateTime + "'" ;
You can’t perform that action at this time.
0 commit comments