diff --git a/feign-client/src/test/java/com/baeldung/feign/clients/BookClientTest.java b/feign-client/src/test/java/com/baeldung/feign/clients/BookClientTest.java index fa470cd0a0..e7e058a336 100644 --- a/feign-client/src/test/java/com/baeldung/feign/clients/BookClientTest.java +++ b/feign-client/src/test/java/com/baeldung/feign/clients/BookClientTest.java @@ -21,16 +21,16 @@ import static org.junit.Assert.assertTrue; @Slf4j @RunWith(JUnit4.class) public class BookClientTest { - private BookControllerFeignClientBuilder feignClientBuilder; + private BookClient bookClient; @Before public void setup() { - feignClientBuilder = new BookControllerFeignClientBuilder(); + BookControllerFeignClientBuilder feignClientBuilder = new BookControllerFeignClientBuilder(); + bookClient = feignClientBuilder.getBookClient(); } @Test public void givenBookClient_shouldRunSuccessfully() throws Exception { - BookClient bookClient = feignClientBuilder.getBookClient(); List books = bookClient.findAll().stream() .map(BookResource::getBook) .collect(Collectors.toList()); @@ -40,7 +40,6 @@ public class BookClientTest { @Test public void givenBookClient_shouldFindOneBook() throws Exception { - BookClient bookClient = feignClientBuilder.getBookClient(); Book book = bookClient.findByIsbn("0151072558").getBook(); assertThat(book.getAuthor(), containsString("Orwell")); log.info("{}", book); @@ -48,7 +47,6 @@ public class BookClientTest { @Test public void givenBookClient_shouldPostBook() throws Exception { - BookClient bookClient = feignClientBuilder.getBookClient(); String isbn = UUID.randomUUID().toString(); Book book = new Book(isbn, "Me", "It's me!", null, null); bookClient.create(book);