Skip to content

Commit

Permalink
Spring Boot update
Browse files Browse the repository at this point in the history
  • Loading branch information
BjoernKW committed Nov 22, 2024
1 parent 61589af commit 6535e88
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.5</version>
<version>3.4.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>de.workshops</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
package de.workshops.bookshelf.book;

import java.util.Collections;
import java.util.List;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;

import java.util.Collections;
import java.util.List;

@WebMvcTest(
controllers = BookRestController.class,
includeFilters = @ComponentScan.Filter(
Expand All @@ -32,7 +31,7 @@ class BookRestControllerMockitoIntegrationTest {
@Autowired
private MockMvc mockMvc;

@MockBean
@MockitoBean
private BookService bookService;

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
package de.workshops.bookshelf.book;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

import java.util.Collections;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.HttpStatus;

import java.util.Collections;
import java.util.List;

import static org.junit.jupiter.api.Assertions.*;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

@WebMvcTest(BookRestController.class)
class BookRestControllerMockitoTest {

@Autowired
private BookRestController bookRestController;

@MockBean
@MockitoBean
private BookService bookService;

@Test
Expand Down

0 comments on commit 6535e88

Please sign in to comment.