Upgrade to SpringBoot 3.4.1 and dependencies #147

Merged
hsh-michaelhoennig merged 35 commits from maintenance/use-latest-versions into master 2025-01-15 13:43:29 +01:00
32 changed files with 93 additions and 93 deletions
Showing only changes of commit e879a61dc7 - Show all commits

View File

@ -14,7 +14,7 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.context.TestConfiguration; import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
@ -48,23 +48,23 @@ class HsBookingItemControllerRestTest {
@Autowired @Autowired
MockMvc mockMvc; MockMvc mockMvc;
@MockBean @MockitoBean
Context contextMock; Context contextMock;
@Autowired @Autowired
@SuppressWarnings("unused") // not used in test, but in controller class @SuppressWarnings("unused") // not used in test, but in controller class
StrictMapper mapper; StrictMapper mapper;
@MockBean @MockitoBean
EntityManagerWrapper em; EntityManagerWrapper em;
@MockBean @MockitoBean
EntityManagerFactory emf; EntityManagerFactory emf;
@MockBean @MockitoBean
HsBookingProjectRealRepository realProjectRepo; HsBookingProjectRealRepository realProjectRepo;
@MockBean @MockitoBean
HsBookingItemRbacRepository rbacBookingItemRepo; HsBookingItemRbacRepository rbacBookingItemRepo;
@TestConfiguration @TestConfiguration

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.jpa.JpaSystemException; import org.springframework.orm.jpa.JpaSystemException;
@ -61,7 +61,7 @@ class HsBookingItemRepositoryIntegrationTest extends ContextBasedTestWithCleanup
@PersistenceContext @PersistenceContext
EntityManager em; EntityManager em;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Test @Test

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.EnumSource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.jpa.JpaSystemException; import org.springframework.orm.jpa.JpaSystemException;
@ -56,7 +56,7 @@ class HsBookingProjectRepositoryIntegrationTest extends ContextBasedTestWithClea
@PersistenceContext @PersistenceContext
EntityManager em; EntityManager em;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Test @Test

View File

@ -24,7 +24,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
@ -62,27 +62,27 @@ public class HsHostingAssetControllerRestTest {
@Autowired @Autowired
MockMvc mockMvc; MockMvc mockMvc;
@MockBean @MockitoBean
Context contextMock; Context contextMock;
@Autowired @Autowired
@SuppressWarnings("unused") // not used in test, but in controller class @SuppressWarnings("unused") // not used in test, but in controller class
StrictMapper mapper; StrictMapper mapper;
@MockBean @MockitoBean
EntityManagerWrapper em; EntityManagerWrapper em;
@MockBean @MockitoBean
EntityManagerFactory emf; EntityManagerFactory emf;
@MockBean @MockitoBean
@SuppressWarnings("unused") // bean needs to be present for HsHostingAssetController @SuppressWarnings("unused") // bean needs to be present for HsHostingAssetController
private HsBookingItemRealRepository realBookingItemRepo; private HsBookingItemRealRepository realBookingItemRepo;
@MockBean @MockitoBean
private HsHostingAssetRealRepository realAssetRepo; private HsHostingAssetRealRepository realAssetRepo;
@MockBean @MockitoBean
private HsHostingAssetRbacRepository rbacAssetRepo; private HsHostingAssetRbacRepository rbacAssetRepo;
@TestConfiguration @TestConfiguration

View File

@ -17,7 +17,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.EnumSource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.jpa.JpaSystemException; import org.springframework.orm.jpa.JpaSystemException;
@ -70,7 +70,7 @@ class HsHostingAssetRepositoryIntegrationTest extends ContextBasedTestWithCleanu
@PersistenceContext @PersistenceContext
EntityManager em; EntityManager em;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Test @Test

View File

@ -14,7 +14,7 @@ import org.junit.jupiter.api.extension.TestWatcher;
import org.opentest4j.AssertionFailedError; import org.opentest4j.AssertionFailedError;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.transaction.support.TransactionTemplate; import org.springframework.transaction.support.TransactionTemplate;
@ -76,7 +76,7 @@ public class CsvDataImport extends ContextBasedTest {
@Autowired @Autowired
JpaAttempt jpaAttempt; JpaAttempt jpaAttempt;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
static final LinkedHashSet<String> errors = new LinkedHashSet<>(); static final LinkedHashSet<String> errors = new LinkedHashSet<>();

View File

@ -7,7 +7,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.EnumSource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
@ -26,14 +26,14 @@ class HsOfficeBankAccountControllerRestTest {
@Autowired @Autowired
MockMvc mockMvc; MockMvc mockMvc;
@MockBean @MockitoBean
Context contextMock; Context contextMock;
@MockBean @MockitoBean
@SuppressWarnings("unused") // not used in test, but in controller class @SuppressWarnings("unused") // not used in test, but in controller class
StrictMapper mapper; StrictMapper mapper;
@MockBean @MockitoBean
HsOfficeBankAccountRepository bankAccountRepo; HsOfficeBankAccountRepository bankAccountRepo;
enum InvalidIbanTestCase { enum InvalidIbanTestCase {

View File

@ -11,7 +11,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
@ -46,7 +46,7 @@ class HsOfficeBankAccountRepositoryIntegrationTest extends ContextBasedTestWithC
@Autowired @Autowired
JpaAttempt jpaAttempt; JpaAttempt jpaAttempt;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -11,7 +11,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
@ -46,7 +46,7 @@ class HsOfficeContactRbacRepositoryIntegrationTest extends ContextBasedTestWithC
@Autowired @Autowired
JpaAttempt jpaAttempt; JpaAttempt jpaAttempt;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -17,10 +17,10 @@ import org.junit.jupiter.params.provider.EnumSource;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
@ -499,20 +499,20 @@ class HsOfficeCoopAssetsTransactionControllerRestTest {
@Autowired @Autowired
MockMvc mockMvc; MockMvc mockMvc;
@MockBean @MockitoBean
Context contextMock; Context contextMock;
@Autowired @Autowired
@SuppressWarnings("unused") // not used in test, but in controller class @SuppressWarnings("unused") // not used in test, but in controller class
StrictMapper mapper; StrictMapper mapper;
@MockBean @MockitoBean
EntityManagerWrapper emw; // even if not used in test anymore, it's needed by base-class of StrictMapper EntityManagerWrapper emw; // even if not used in test anymore, it's needed by base-class of StrictMapper
@MockBean @MockitoBean
HsOfficeCoopAssetsTransactionRepository coopAssetsTransactionRepo; HsOfficeCoopAssetsTransactionRepository coopAssetsTransactionRepo;
@MockBean @MockitoBean
HsOfficeMembershipRepository membershipRepo; HsOfficeMembershipRepository membershipRepo;
static final String INSERT_REQUEST_BODY_TEMPLATE = """ static final String INSERT_REQUEST_BODY_TEMPLATE = """

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
@ -51,7 +51,7 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase
@Autowired @Autowired
JpaAttempt jpaAttempt; JpaAttempt jpaAttempt;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -8,7 +8,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.EnumSource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
@ -31,14 +31,14 @@ class HsOfficeCoopSharesTransactionControllerRestTest {
@Autowired @Autowired
MockMvc mockMvc; MockMvc mockMvc;
@MockBean @MockitoBean
Context contextMock; Context contextMock;
@MockBean @MockitoBean
@SuppressWarnings("unused") // not used in test, but in controller class @SuppressWarnings("unused") // not used in test, but in controller class
StrictMapper mapper; StrictMapper mapper;
@MockBean @MockitoBean
HsOfficeCoopSharesTransactionRepository coopSharesTransactionRepo; HsOfficeCoopSharesTransactionRepository coopSharesTransactionRepo;
static final String VALID_INSERT_REQUEST_BODY = """ static final String VALID_INSERT_REQUEST_BODY = """

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
@ -50,7 +50,7 @@ class HsOfficeCoopSharesTransactionRepositoryIntegrationTest extends ContextBase
@Autowired @Autowired
JpaAttempt jpaAttempt; JpaAttempt jpaAttempt;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -22,7 +22,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource; import org.junit.jupiter.params.provider.ValueSource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.jpa.JpaSystemException; import org.springframework.orm.jpa.JpaSystemException;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -74,7 +74,7 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
@Autowired @Autowired
RbacGrantsDiagramService mermaidService; RbacGrantsDiagramService mermaidService;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested
class CreateDebitor { class CreateDebitor {

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.EnumSource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
@ -70,19 +70,19 @@ public class HsOfficeMembershipControllerRestTest {
@Autowired @Autowired
MockMvc mockMvc; MockMvc mockMvc;
@MockBean @MockitoBean
Context contextMock; Context contextMock;
@MockBean @MockitoBean
HsOfficeCoopAssetsTransactionRepository coopAssetsTransactionRepo; HsOfficeCoopAssetsTransactionRepository coopAssetsTransactionRepo;
@MockBean @MockitoBean
HsOfficePartnerRepository partnerRepo; HsOfficePartnerRepository partnerRepo;
@MockBean @MockitoBean
HsOfficeMembershipRepository membershipRepo; HsOfficeMembershipRepository membershipRepo;
@MockBean @MockitoBean
EntityManagerWrapper em; EntityManagerWrapper em;
@Nested @Nested

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.jpa.JpaSystemException; import org.springframework.orm.jpa.JpaSystemException;
@ -54,7 +54,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTestWithCl
@Autowired @Autowired
JpaAttempt jpaAttempt; JpaAttempt jpaAttempt;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test;
import org.mockito.Mock; import org.mockito.Mock;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
@ -50,19 +50,19 @@ class HsOfficePartnerControllerRestTest {
@Autowired @Autowired
MockMvc mockMvc; MockMvc mockMvc;
@MockBean @MockitoBean
Context contextMock; Context contextMock;
@MockBean @MockitoBean
HsOfficePartnerRepository partnerRepo; HsOfficePartnerRepository partnerRepo;
@MockBean @MockitoBean
HsOfficeRelationRealRepository relationRepo; HsOfficeRelationRealRepository relationRepo;
@MockBean @MockitoBean
EntityManagerWrapper em; EntityManagerWrapper em;
@MockBean @MockitoBean
EntityManagerFactory emf; EntityManagerFactory emf;
@Mock @Mock

View File

@ -16,7 +16,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; // FIXME: use MockitoBean import org.springframework.test.context.bean.override.mockito.MockitoBean; // FIXME: use MockitoBean
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.jpa.JpaSystemException; import org.springframework.orm.jpa.JpaSystemException;
@ -67,7 +67,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTestWithClean
@Autowired @Autowired
JpaAttempt jpaAttempt; JpaAttempt jpaAttempt;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -11,7 +11,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
@ -46,7 +46,7 @@ class HsOfficePersonRbacRepositoryIntegrationTest extends ContextBasedTestWithCl
@Autowired @Autowired
JpaAttempt jpaAttempt; JpaAttempt jpaAttempt;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -10,7 +10,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
@ -44,7 +44,7 @@ class HsOfficePersonRealRepositoryIntegrationTest extends ContextBasedTestWithCl
@Autowired @Autowired
JpaAttempt jpaAttempt; JpaAttempt jpaAttempt;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Autowired @Autowired
private HsOfficePersonRealRepository hsOfficePersonRealRepository; private HsOfficePersonRealRepository hsOfficePersonRealRepository;

View File

@ -9,7 +9,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
@ -35,7 +35,7 @@ class HsOfficeRealRelationRepositoryIntegrationTest extends ContextBasedTestWith
@PersistenceContext @PersistenceContext
EntityManager em; EntityManager em;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.jpa.JpaSystemException; import org.springframework.orm.jpa.JpaSystemException;
@ -58,7 +58,7 @@ class HsOfficeRelationRepositoryIntegrationTest extends ContextBasedTestWithClea
@Autowired @Autowired
JpaAttempt jpaAttempt; JpaAttempt jpaAttempt;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.jpa.JpaSystemException; import org.springframework.orm.jpa.JpaSystemException;
@ -55,7 +55,7 @@ class HsOfficeSepaMandateRepositoryIntegrationTest extends ContextBasedTestWithC
@PersistenceContext @PersistenceContext
EntityManager em; EntityManager em;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -8,7 +8,7 @@ import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -27,7 +27,7 @@ class ContextIntegrationTests {
@Autowired @Autowired
private Context context; private Context context;
@MockBean @MockitoBean
@SuppressWarnings("unused") // the bean must be present, even though it's not used directly @SuppressWarnings("unused") // the bean must be present, even though it's not used directly
private HttpServletRequest request; private HttpServletRequest request;

View File

@ -10,7 +10,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.jpa.JpaSystemException; import org.springframework.orm.jpa.JpaSystemException;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
@ -32,7 +32,7 @@ class RbacGrantRepositoryIntegrationTest extends ContextBasedTest {
@Autowired @Autowired
Context context; Context context;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Autowired @Autowired

View File

@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.TestInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
@ -28,7 +28,7 @@ class RbacGrantsDiagramServiceIntegrationTest extends ContextBasedTestWithCleanu
@Autowired @Autowired
RbacGrantsDiagramService grantsMermaidService; RbacGrantsDiagramService grantsMermaidService;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Autowired @Autowired

View File

@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
@ -39,16 +39,16 @@ class RbacRoleControllerRestTest {
@Autowired @Autowired
MockMvc mockMvc; MockMvc mockMvc;
@MockBean @MockitoBean
Context contextMock; Context contextMock;
@MockBean @MockitoBean
RbacRoleRepository rbacRoleRepository; RbacRoleRepository rbacRoleRepository;
@MockBean @MockitoBean
EntityManagerWrapper em; EntityManagerWrapper em;
@MockBean @MockitoBean
EntityManagerFactory emf; EntityManagerFactory emf;
@BeforeEach @BeforeEach

View File

@ -7,7 +7,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.jpa.JpaSystemException; import org.springframework.orm.jpa.JpaSystemException;
@ -31,7 +31,7 @@ class RbacRoleRepositoryIntegrationTest {
@Autowired @Autowired
EntityManager em; EntityManager em;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
@ -34,13 +34,13 @@ class RbacSubjectControllerRestTest {
@Autowired @Autowired
MockMvc mockMvc; MockMvc mockMvc;
@MockBean @MockitoBean
Context contextMock; Context contextMock;
@MockBean @MockitoBean
RbacSubjectRepository rbacSubjectRepository; RbacSubjectRepository rbacSubjectRepository;
@MockBean @MockitoBean
EntityManagerWrapper em; EntityManagerWrapper em;

View File

@ -8,7 +8,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.jpa.JpaSystemException; import org.springframework.orm.jpa.JpaSystemException;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
@ -37,7 +37,7 @@ class RbacSubjectRepositoryIntegrationTest extends ContextBasedTest {
@PersistenceContext @PersistenceContext
EntityManager em; EntityManager em;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -7,7 +7,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import jakarta.persistence.PersistenceException; import jakarta.persistence.PersistenceException;
@ -25,7 +25,7 @@ class TestCustomerRepositoryIntegrationTest extends ContextBasedTest {
@Autowired @Autowired
TestCustomerRepository testCustomerRepository; TestCustomerRepository testCustomerRepository;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested

View File

@ -7,7 +7,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.orm.ObjectOptimisticLockingFailureException; import org.springframework.orm.ObjectOptimisticLockingFailureException;
@ -31,7 +31,7 @@ class TestPackageRepositoryIntegrationTest extends ContextBasedTest {
@Autowired @Autowired
JpaAttempt jpaAttempt; JpaAttempt jpaAttempt;
@MockBean @MockitoBean
HttpServletRequest request; HttpServletRequest request;
@Nested @Nested