Skip to content

Commit

Permalink
Fix deprecation compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
runeflobakk committed May 4, 2023
1 parent 0620f33 commit 5265ce3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

Expand All @@ -16,7 +16,7 @@ private static ObjectMapper initMapper() {
mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.LOWER_CAMEL_CASE);
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.LOWER_CAMEL_CASE);
return mapper;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ void testJacksonJsonMarshallingAlltypes() {
static void testJacksonJsonMarshalling(DataTypeIdentifier example) {
try {
ObjectMapper mapper = DataTypesJsonMapper.getMapper();
mapper.enableDefaultTyping();
final String json = mapper.writer().writeValueAsString(example.getExample());
final DataType unmarshalled = mapper.reader().forType(example.getDataType()).readValue(json);
assertThat(unmarshalled, equalTo(example.getExample()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import org.junit.jupiter.api.Test;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.equalTo;
Expand Down Expand Up @@ -59,8 +56,8 @@ void period() {
void repeating_fra_til() {
YearlyRepeatingPeriod period = new YearlyRepeatingPeriod(
2019, 2022
, new CalendarDate(3, 1, 0, 0, "+01:00")
, new CalendarDate(10, 1, 0, 0, "+01:00")
, new CalendarDate(3, 1, 0, 0)
, new CalendarDate(10, 1, 0, 0)
);

assertThat(period.getISO8601(), equalTo("R/2019-03-01T00:00/2022-10-01T00:00"));
Expand All @@ -70,8 +67,8 @@ void repeating_fra_til() {
void repeating_fra() {
YearlyRepeatingPeriod period = new YearlyRepeatingPeriod(
null, 2022
, new CalendarDate(5, 1, 0, 0, "+01:00")
, new CalendarDate(10, 1, 0, 0, "+01:00")
, new CalendarDate(5, 1, 0, 0)
, new CalendarDate(10, 1, 0, 0)
);

assertThat(period.getISO8601(), equalTo("R/05-01T00:00/2022-10-01T00:00"));
Expand All @@ -81,8 +78,8 @@ void repeating_fra() {
void repeating_to() {
YearlyRepeatingPeriod period = new YearlyRepeatingPeriod(
2019, null
, new CalendarDate(5, 1, 0, 0, "+01:00")
, new CalendarDate(10, 1, 0, 0, "+01:00")
, new CalendarDate(5, 1, 0, 0)
, new CalendarDate(10, 1, 0, 0)
);

assertThat(period.getISO8601(), equalTo("R/2019-05-01T00:00/10-01T00:00"));
Expand All @@ -92,8 +89,8 @@ void repeating_to() {
void repeating() {
YearlyRepeatingPeriod period = new YearlyRepeatingPeriod(
null, null
, new CalendarDate(5, 1, 0, 0, "+01:00")
, new CalendarDate(10, 1, 0, 0, "+01:00")
, new CalendarDate(5, 1, 0, 0)
, new CalendarDate(10, 1, 0, 0)
);

assertThat(period.getISO8601(), equalTo("R/05-01T00:00/10-01T00:00"));
Expand All @@ -103,15 +100,16 @@ void repeating() {
void repeating_only_required() {
YearlyRepeatingPeriod period = new YearlyRepeatingPeriod(
null, null
, new CalendarDate(5, 1, null, null, null)
, new CalendarDate(10, 1, null, null, null)
, new CalendarDate(5, 1, null, null)
, new CalendarDate(10, 1, null, null)
);

assertThat(period.getISO8601(), equalTo("R/05-01T00:00/10-01T00:00"));
}

@Test
void repeating_discard_esoteric_timezones() {
@SuppressWarnings("deprecation")
YearlyRepeatingPeriod period = new YearlyRepeatingPeriod(
null, null
, new CalendarDate(5, 1, 0, 0, "+03:00")
Expand Down

0 comments on commit 5265ce3

Please sign in to comment.