From dd5e9802a4ce8b7f0c5f4549d876c3f2febc4367 Mon Sep 17 00:00:00 2001 From: John Blum Date: Wed, 24 Mar 2021 02:57:39 -0700 Subject: [PATCH] Use static import for the AssertJ Assertions class, assertThat(..) method. --- ...AutoConfiguredCachingIntegrationTests.java | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/caching/AutoConfiguredCachingIntegrationTests.java b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/caching/AutoConfiguredCachingIntegrationTests.java index 3b51fdde..8a311f0a 100644 --- a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/caching/AutoConfiguredCachingIntegrationTests.java +++ b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/caching/AutoConfiguredCachingIntegrationTests.java @@ -35,8 +35,6 @@ import org.springframework.data.gemfire.tests.integration.IntegrationTestsSuppor import org.springframework.data.gemfire.util.RegionUtils; import org.springframework.test.context.junit4.SpringRunner; -import org.assertj.core.api.Assertions; - import example.app.books.NonBeanType; import example.app.books.model.Book; import example.app.books.service.support.CachingBookService; @@ -71,53 +69,53 @@ public class AutoConfiguredCachingIntegrationTests extends IntegrationTestsSuppo private void assertBook(Book book, String title) { - Assertions.assertThat(book).isNotNull(); - Assertions.assertThat(book.isNew()).isFalse(); - Assertions.assertThat(book.getTitle()).isEqualTo(title); + assertThat(book).isNotNull(); + assertThat(book.isNew()).isFalse(); + assertThat(book.getTitle()).isEqualTo(title); } @Test public void bookServiceWasConfiguredCorrectly() { - Assertions.assertThat(this.bookService).isNotNull(); - Assertions.assertThat(this.bookService.isCacheMiss()).isFalse(); + assertThat(this.bookService).isNotNull(); + assertThat(this.bookService.isCacheMiss()).isFalse(); } @Test public void cachedBooksRegionWasConfiguredCorrectly() { - Assertions.assertThat(this.cachedBooks).isNotNull(); + assertThat(this.cachedBooks).isNotNull(); assertThat(this.cachedBooks.getName()).isEqualTo("CachedBooks"); assertThat(this.cachedBooks.getFullPath()).isEqualTo(RegionUtils.toRegionPath("CachedBooks")); - Assertions.assertThat(this.cachedBooks).isEmpty(); + assertThat(this.cachedBooks).isEmpty(); } @Test public void geodeAsTheCachingProviderWasAutoConfiguredCorrectly() { - Assertions.assertThat(this.cachedBooks).isEmpty(); + assertThat(this.cachedBooks).isEmpty(); Book bookOne = this.bookService.findByTitle("Star Wars 3 - Revenge of the Sith"); assertBook(bookOne, "Star Wars 3 - Revenge of the Sith"); - Assertions.assertThat(this.bookService.isCacheMiss()).isTrue(); - Assertions.assertThat(this.cachedBooks).hasSize(1); - Assertions.assertThat(this.cachedBooks.get(bookOne.getTitle())).isEqualTo(bookOne); + assertThat(this.bookService.isCacheMiss()).isTrue(); + assertThat(this.cachedBooks).hasSize(1); + assertThat(this.cachedBooks.get(bookOne.getTitle())).isEqualTo(bookOne); Book bookOneAgain = this.bookService.findByTitle(bookOne.getTitle()); - Assertions.assertThat(bookOneAgain).isEqualTo(bookOne); - Assertions.assertThat(this.bookService.isCacheMiss()).isFalse(); - Assertions.assertThat(this.cachedBooks).hasSize(1); - Assertions.assertThat(this.cachedBooks.get(bookOne.getTitle())).isEqualTo(bookOne); + assertThat(bookOneAgain).isEqualTo(bookOne); + assertThat(this.bookService.isCacheMiss()).isFalse(); + assertThat(this.cachedBooks).hasSize(1); + assertThat(this.cachedBooks.get(bookOne.getTitle())).isEqualTo(bookOne); Book bookTwo = this.bookService.findByTitle("Star Wars 6 - Return of the Jedi"); assertBook(bookTwo, "Star Wars 6 - Return of the Jedi"); - Assertions.assertThat(this.bookService.isCacheMiss()).isTrue(); - Assertions.assertThat(this.cachedBooks).hasSize(2); - Assertions.assertThat(this.cachedBooks.get(bookOne.getTitle())).isEqualTo(bookOne); - Assertions.assertThat(this.cachedBooks.get(bookTwo.getTitle())).isEqualTo(bookTwo); + assertThat(this.bookService.isCacheMiss()).isTrue(); + assertThat(this.cachedBooks).hasSize(2); + assertThat(this.cachedBooks.get(bookOne.getTitle())).isEqualTo(bookOne); + assertThat(this.cachedBooks.get(bookTwo.getTitle())).isEqualTo(bookTwo); } @SpringBootApplication(scanBasePackageClasses = NonBeanType.class)