From d2503be5448672975c46d5cc5dc607afbf21455e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 10 May 2018 09:50:44 +0300 Subject: [PATCH] Fix deprecation warnings --- src/main/java/io/spring/api/ArticlesApi.java | 2 +- src/main/java/io/spring/api/CommentsApi.java | 2 +- src/main/java/io/spring/api/CurrentUserApi.java | 2 +- src/main/java/io/spring/api/UsersApi.java | 4 ++-- src/test/java/io/spring/api/ArticleApiTest.java | 6 +++--- src/test/java/io/spring/api/ArticleFavoriteApiTest.java | 4 ++-- src/test/java/io/spring/api/ArticlesApiTest.java | 2 +- src/test/java/io/spring/api/CommentsApiTest.java | 6 +++--- src/test/java/io/spring/api/CurrentUserApiTest.java | 4 ++-- src/test/java/io/spring/api/ListArticleApiTest.java | 2 +- src/test/java/io/spring/api/ProfileApiTest.java | 2 +- src/test/java/io/spring/api/TestWithCurrentUser.java | 2 +- src/test/java/io/spring/api/UsersApiTest.java | 4 ++-- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/io/spring/api/ArticlesApi.java b/src/main/java/io/spring/api/ArticlesApi.java index a4f72d3..56997b4 100644 --- a/src/main/java/io/spring/api/ArticlesApi.java +++ b/src/main/java/io/spring/api/ArticlesApi.java @@ -9,7 +9,7 @@ import io.spring.core.article.ArticleRepository; import io.spring.core.user.User; import lombok.Getter; import lombok.NoArgsConstructor; -import org.hibernate.validator.constraints.NotBlank; +import javax.validation.constraints.NotBlank; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.security.core.annotation.AuthenticationPrincipal; diff --git a/src/main/java/io/spring/api/CommentsApi.java b/src/main/java/io/spring/api/CommentsApi.java index eccbd18..ce38bd8 100644 --- a/src/main/java/io/spring/api/CommentsApi.java +++ b/src/main/java/io/spring/api/CommentsApi.java @@ -14,7 +14,7 @@ import io.spring.core.comment.CommentRepository; import io.spring.core.user.User; import lombok.Getter; import lombok.NoArgsConstructor; -import org.hibernate.validator.constraints.NotBlank; +import javax.validation.constraints.NotBlank; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.security.core.annotation.AuthenticationPrincipal; diff --git a/src/main/java/io/spring/api/CurrentUserApi.java b/src/main/java/io/spring/api/CurrentUserApi.java index 33115e4..7de1775 100644 --- a/src/main/java/io/spring/api/CurrentUserApi.java +++ b/src/main/java/io/spring/api/CurrentUserApi.java @@ -9,7 +9,7 @@ import io.spring.core.user.User; import io.spring.core.user.UserRepository; import lombok.Getter; import lombok.NoArgsConstructor; -import org.hibernate.validator.constraints.Email; +import javax.validation.constraints.Email; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.security.core.annotation.AuthenticationPrincipal; diff --git a/src/main/java/io/spring/api/UsersApi.java b/src/main/java/io/spring/api/UsersApi.java index df291bf..a6e599f 100644 --- a/src/main/java/io/spring/api/UsersApi.java +++ b/src/main/java/io/spring/api/UsersApi.java @@ -11,8 +11,8 @@ import io.spring.core.user.User; import io.spring.core.user.UserRepository; import lombok.Getter; import lombok.NoArgsConstructor; -import org.hibernate.validator.constraints.Email; -import org.hibernate.validator.constraints.NotBlank; +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; diff --git a/src/test/java/io/spring/api/ArticleApiTest.java b/src/test/java/io/spring/api/ArticleApiTest.java index 5f6a75f..dd63a7a 100644 --- a/src/test/java/io/spring/api/ArticleApiTest.java +++ b/src/test/java/io/spring/api/ArticleApiTest.java @@ -27,9 +27,9 @@ import java.util.Optional; import static io.restassured.module.mockmvc.RestAssuredMockMvc.given; import static org.hamcrest.core.IsEqual.equalTo; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/src/test/java/io/spring/api/ArticleFavoriteApiTest.java b/src/test/java/io/spring/api/ArticleFavoriteApiTest.java index 8fc2113..a1e25ae 100644 --- a/src/test/java/io/spring/api/ArticleFavoriteApiTest.java +++ b/src/test/java/io/spring/api/ArticleFavoriteApiTest.java @@ -25,8 +25,8 @@ import java.util.stream.Collectors; import static io.restassured.module.mockmvc.RestAssuredMockMvc.given; import static org.hamcrest.core.IsEqual.equalTo; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/src/test/java/io/spring/api/ArticlesApiTest.java b/src/test/java/io/spring/api/ArticlesApiTest.java index 91c1d39..2bb6c1e 100644 --- a/src/test/java/io/spring/api/ArticlesApiTest.java +++ b/src/test/java/io/spring/api/ArticlesApiTest.java @@ -23,7 +23,7 @@ import java.util.Optional; import static io.restassured.module.mockmvc.RestAssuredMockMvc.given; import static org.hamcrest.core.IsEqual.equalTo; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/src/test/java/io/spring/api/CommentsApiTest.java b/src/test/java/io/spring/api/CommentsApiTest.java index 3151b08..6e4f4f0 100644 --- a/src/test/java/io/spring/api/CommentsApiTest.java +++ b/src/test/java/io/spring/api/CommentsApiTest.java @@ -26,9 +26,9 @@ import java.util.Optional; import static io.restassured.module.mockmvc.RestAssuredMockMvc.given; import static org.hamcrest.core.IsEqual.equalTo; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @WebMvcTest(CommentsApi.class) diff --git a/src/test/java/io/spring/api/CurrentUserApiTest.java b/src/test/java/io/spring/api/CurrentUserApiTest.java index 0560912..5ae2475 100644 --- a/src/test/java/io/spring/api/CurrentUserApiTest.java +++ b/src/test/java/io/spring/api/CurrentUserApiTest.java @@ -19,8 +19,8 @@ import java.util.Optional; import static io.restassured.module.mockmvc.RestAssuredMockMvc.given; import static org.hamcrest.core.IsEqual.equalTo; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @WebMvcTest(CurrentUserApi.class) diff --git a/src/test/java/io/spring/api/ListArticleApiTest.java b/src/test/java/io/spring/api/ListArticleApiTest.java index 91c2e36..a0762de 100644 --- a/src/test/java/io/spring/api/ListArticleApiTest.java +++ b/src/test/java/io/spring/api/ListArticleApiTest.java @@ -18,7 +18,7 @@ import org.springframework.test.web.servlet.MockMvc; import static io.restassured.module.mockmvc.RestAssuredMockMvc.given; import static io.spring.TestHelper.articleDataFixture; import static java.util.Arrays.asList; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @WebMvcTest(ArticlesApi.class) diff --git a/src/test/java/io/spring/api/ProfileApiTest.java b/src/test/java/io/spring/api/ProfileApiTest.java index dddce43..cb69658 100644 --- a/src/test/java/io/spring/api/ProfileApiTest.java +++ b/src/test/java/io/spring/api/ProfileApiTest.java @@ -19,7 +19,7 @@ import java.util.Optional; import static io.restassured.module.mockmvc.RestAssuredMockMvc.given; import static org.hamcrest.core.IsEqual.equalTo; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/src/test/java/io/spring/api/TestWithCurrentUser.java b/src/test/java/io/spring/api/TestWithCurrentUser.java index 67a5a12..9c8f62b 100644 --- a/src/test/java/io/spring/api/TestWithCurrentUser.java +++ b/src/test/java/io/spring/api/TestWithCurrentUser.java @@ -12,7 +12,7 @@ import org.springframework.test.context.junit4.SpringRunner; import java.util.Optional; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @RunWith(SpringRunner.class) diff --git a/src/test/java/io/spring/api/UsersApiTest.java b/src/test/java/io/spring/api/UsersApiTest.java index 0176e05..e13ef20 100644 --- a/src/test/java/io/spring/api/UsersApiTest.java +++ b/src/test/java/io/spring/api/UsersApiTest.java @@ -26,8 +26,8 @@ import java.util.Optional; import static io.restassured.module.mockmvc.RestAssuredMockMvc.given; import static org.hamcrest.core.IsEqual.equalTo; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when;