#1639 - Prepare 2.0 development.
Upgrade to Java 17 and Spring Framework 6. Switch to JakartaEE 9 version of the Servlet API. Drop support for Joda Time. Configure Kotlin plugin to target JDK 1.8 as it doesn't support 17, yet.
This commit is contained in:
@@ -17,8 +17,6 @@ package org.springframework.hateoas;
|
||||
|
||||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.*;
|
||||
|
||||
import lombok.var;
|
||||
|
||||
import org.springframework.hateoas.SimpleRepresentationModelAssemblerTest.Employee;
|
||||
import org.springframework.hateoas.mediatype.Affordances;
|
||||
import org.springframework.http.HttpMethod;
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.hateoas.server.mvc;
|
||||
|
||||
import jakarta.servlet.ServletContext;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -25,8 +27,6 @@ import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.format.support.DefaultFormattingConversionService;
|
||||
|
||||
@@ -17,10 +17,10 @@ package org.springframework.hateoas;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.springframework.mock.web.MockFilterChain;
|
||||
|
||||
@@ -18,13 +18,13 @@ package org.springframework.hateoas.server.mvc;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.format.ISODateTimeFormat;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -96,11 +96,11 @@ class WebMvcLinkBuilderFactoryUnitTest extends TestUtils {
|
||||
@Test
|
||||
void usesDateTimeFormatForUriBinding() {
|
||||
|
||||
DateTime now = DateTime.now();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
WebMvcLinkBuilderFactory factory = new WebMvcLinkBuilderFactory();
|
||||
Link link = factory.linkTo(methodOn(SampleController.class).sampleMethod(now)).withSelfRel();
|
||||
assertThat(link.getHref()).endsWith("/sample/" + ISODateTimeFormat.date().print(now));
|
||||
assertThat(link.getHref()).endsWith("/sample/" + now.format(DateTimeFormatter.ISO_DATE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +190,7 @@ class WebMvcLinkBuilderFactoryUnitTest extends TestUtils {
|
||||
HttpEntity<?> sampleMethod(@PathVariable("id") Long id, SpecialType parameter);
|
||||
|
||||
@RequestMapping("/sample/{time}")
|
||||
HttpEntity<?> sampleMethod(@PathVariable("time") @DateTimeFormat(iso = ISO.DATE) DateTime time);
|
||||
HttpEntity<?> sampleMethod(@PathVariable("time") @DateTimeFormat(iso = ISO.DATE) LocalDateTime time);
|
||||
|
||||
@RequestMapping("/sample/mapsupport")
|
||||
HttpEntity<?> sampleMethodWithMap(@RequestParam Map<String, String> queryParams);
|
||||
|
||||
Reference in New Issue
Block a user