From 0cd80319bd72a8bbb79556acc822c17c8dae031d Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 1 Jul 2018 16:30:43 +0300 Subject: [PATCH] update to spring 5 --- spring-data-rest/pom.xml | 4 ++-- .../src/main/java/com/baeldung/config/MvcConfig.java | 7 ++----- .../projection/SpringDataProjectionIntegrationTest.java | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/spring-data-rest/pom.xml b/spring-data-rest/pom.xml index 0e525474e3..b3d2b0e359 100644 --- a/spring-data-rest/pom.xml +++ b/spring-data-rest/pom.xml @@ -10,10 +10,10 @@ Intro to Spring Data REST - parent-boot-1 + parent-boot-2 com.baeldung 0.0.1-SNAPSHOT - ../parent-boot-1 + ../parent-boot-2 diff --git a/spring-data-rest/src/main/java/com/baeldung/config/MvcConfig.java b/spring-data-rest/src/main/java/com/baeldung/config/MvcConfig.java index 82cb936348..e5748f2f55 100644 --- a/spring-data-rest/src/main/java/com/baeldung/config/MvcConfig.java +++ b/spring-data-rest/src/main/java/com/baeldung/config/MvcConfig.java @@ -3,17 +3,14 @@ package com.baeldung.config; import com.baeldung.events.AuthorEventHandler; import com.baeldung.events.BookEventHandler; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -import org.springframework.web.servlet.view.InternalResourceViewResolver; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration @EnableWebMvc -public class MvcConfig extends WebMvcConfigurerAdapter{ +public class MvcConfig implements WebMvcConfigurer { public MvcConfig(){ super(); diff --git a/spring-data-rest/src/test/java/com/baeldung/projection/SpringDataProjectionIntegrationTest.java b/spring-data-rest/src/test/java/com/baeldung/projection/SpringDataProjectionIntegrationTest.java index 4091fdf154..2b1f6d4d4f 100644 --- a/spring-data-rest/src/test/java/com/baeldung/projection/SpringDataProjectionIntegrationTest.java +++ b/spring-data-rest/src/test/java/com/baeldung/projection/SpringDataProjectionIntegrationTest.java @@ -38,7 +38,7 @@ public class SpringDataProjectionIntegrationTest { @Before public void setup(){ - if(bookRepo.findOne(1L) == null){ + if(bookRepo.findById(1L) == null){ Book book = new Book("Animal Farm"); book.setIsbn("978-1943138425"); book = bookRepo.save(book);