JAVA-4611: Update deprecations in spring-boot-rest module

This commit is contained in:
sampadawagde 2021-02-23 22:36:42 +05:30
parent f6470356d2
commit 9d7a90cab9
4 changed files with 4 additions and 6 deletions

View File

@ -50,7 +50,7 @@ public class CustomerController {
}
Link link = linkTo(methodOn(CustomerController.class).getOrdersForCustomer(customerId)).withSelfRel();
CollectionModel<Order> result = new CollectionModel<>(orders, link);
CollectionModel<Order> result = CollectionModel.of(orders, link);
return result;
}
@ -72,7 +72,7 @@ public class CustomerController {
}
Link link = linkTo(CustomerController.class).withSelfRel();
CollectionModel<Customer> result = new CollectionModel<>(allCustomers, link);
CollectionModel<Customer> result = CollectionModel.of(allCustomers, link);
return result;
}

View File

@ -33,7 +33,7 @@ public class ExamplePostControllerRequestIntegrationTest {
@Before
public void preTest() {
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);
mockMvc = MockMvcBuilders
.standaloneSetup(exampleController)
.build();

View File

@ -34,7 +34,7 @@ public class ExamplePostControllerResponseIntegrationTest {
@Before
public void preTest() {
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);
mockMvc = MockMvcBuilders
.standaloneSetup(exampleController)
.build();

View File

@ -8,12 +8,10 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.web.server.MediaTypeNotSupportedStatusException;
import com.baeldung.web.controller.students.Student;
import com.fasterxml.jackson.databind.ObjectMapper;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;