deprecated @MockBean -> @MockitoBean

This commit is contained in:
Michael Hoennig 2025-01-13 11:18:23 +01:00
parent 4d5cb239f3
commit e879a61dc7
32 changed files with 93 additions and 93 deletions

View File

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

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.jpa.JpaSystemException;
@ -61,7 +61,7 @@ class HsBookingItemRepositoryIntegrationTest extends ContextBasedTestWithCleanup
@PersistenceContext
EntityManager em;
@MockBean
@MockitoBean
HttpServletRequest request;
@Test

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.jpa.JpaSystemException;
@ -56,7 +56,7 @@ class HsBookingProjectRepositoryIntegrationTest extends ContextBasedTestWithClea
@PersistenceContext
EntityManager em;
@MockBean
@MockitoBean
HttpServletRequest request;
@Test

View File

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

View File

@ -17,7 +17,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.jpa.JpaSystemException;
@ -70,7 +70,7 @@ class HsHostingAssetRepositoryIntegrationTest extends ContextBasedTestWithCleanu
@PersistenceContext
EntityManager em;
@MockBean
@MockitoBean
HttpServletRequest request;
@Test

View File

@ -14,7 +14,7 @@ import org.junit.jupiter.api.extension.TestWatcher;
import org.opentest4j.AssertionFailedError;
import org.springframework.beans.factory.annotation.Autowired;
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.transaction.support.TransactionTemplate;
@ -76,7 +76,7 @@ public class CsvDataImport extends ContextBasedTest {
@Autowired
JpaAttempt jpaAttempt;
@MockBean
@MockitoBean
HttpServletRequest request;
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.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.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
@ -26,14 +26,14 @@ class HsOfficeBankAccountControllerRestTest {
@Autowired
MockMvc mockMvc;
@MockBean
@MockitoBean
Context contextMock;
@MockBean
@MockitoBean
@SuppressWarnings("unused") // not used in test, but in controller class
StrictMapper mapper;
@MockBean
@MockitoBean
HsOfficeBankAccountRepository bankAccountRepo;
enum InvalidIbanTestCase {

View File

@ -11,7 +11,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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 jakarta.persistence.EntityManager;
@ -46,7 +46,7 @@ class HsOfficeBankAccountRepositoryIntegrationTest extends ContextBasedTestWithC
@Autowired
JpaAttempt jpaAttempt;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -11,7 +11,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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 jakarta.persistence.EntityManager;
@ -46,7 +46,7 @@ class HsOfficeContactRbacRepositoryIntegrationTest extends ContextBasedTestWithC
@Autowired
JpaAttempt jpaAttempt;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -17,10 +17,10 @@ import org.junit.jupiter.params.provider.EnumSource;
import org.junit.runner.RunWith;
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.context.annotation.Import;
import org.springframework.http.MediaType;
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.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
@ -499,20 +499,20 @@ class HsOfficeCoopAssetsTransactionControllerRestTest {
@Autowired
MockMvc mockMvc;
@MockBean
@MockitoBean
Context contextMock;
@Autowired
@SuppressWarnings("unused") // not used in test, but in controller class
StrictMapper mapper;
@MockBean
@MockitoBean
EntityManagerWrapper emw; // even if not used in test anymore, it's needed by base-class of StrictMapper
@MockBean
@MockitoBean
HsOfficeCoopAssetsTransactionRepository coopAssetsTransactionRepo;
@MockBean
@MockitoBean
HsOfficeMembershipRepository membershipRepo;
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.springframework.beans.factory.annotation.Autowired;
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 jakarta.persistence.EntityManager;
@ -51,7 +51,7 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase
@Autowired
JpaAttempt jpaAttempt;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -8,7 +8,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
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.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
@ -31,14 +31,14 @@ class HsOfficeCoopSharesTransactionControllerRestTest {
@Autowired
MockMvc mockMvc;
@MockBean
@MockitoBean
Context contextMock;
@MockBean
@MockitoBean
@SuppressWarnings("unused") // not used in test, but in controller class
StrictMapper mapper;
@MockBean
@MockitoBean
HsOfficeCoopSharesTransactionRepository coopSharesTransactionRepo;
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.springframework.beans.factory.annotation.Autowired;
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 jakarta.persistence.EntityManager;
@ -50,7 +50,7 @@ class HsOfficeCoopSharesTransactionRepositoryIntegrationTest extends ContextBase
@Autowired
JpaAttempt jpaAttempt;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -22,7 +22,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.jpa.JpaSystemException;
import org.springframework.transaction.annotation.Transactional;
@ -74,7 +74,7 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
@Autowired
RbacGrantsDiagramService mermaidService;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested
class CreateDebitor {

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
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.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
@ -70,19 +70,19 @@ public class HsOfficeMembershipControllerRestTest {
@Autowired
MockMvc mockMvc;
@MockBean
@MockitoBean
Context contextMock;
@MockBean
@MockitoBean
HsOfficeCoopAssetsTransactionRepository coopAssetsTransactionRepo;
@MockBean
@MockitoBean
HsOfficePartnerRepository partnerRepo;
@MockBean
@MockitoBean
HsOfficeMembershipRepository membershipRepo;
@MockBean
@MockitoBean
EntityManagerWrapper em;
@Nested

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.jpa.JpaSystemException;
@ -54,7 +54,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTestWithCl
@Autowired
JpaAttempt jpaAttempt;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test;
import org.mockito.Mock;
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.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
@ -50,19 +50,19 @@ class HsOfficePartnerControllerRestTest {
@Autowired
MockMvc mockMvc;
@MockBean
@MockitoBean
Context contextMock;
@MockBean
@MockitoBean
HsOfficePartnerRepository partnerRepo;
@MockBean
@MockitoBean
HsOfficeRelationRealRepository relationRepo;
@MockBean
@MockitoBean
EntityManagerWrapper em;
@MockBean
@MockitoBean
EntityManagerFactory emf;
@Mock

View File

@ -16,7 +16,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.jpa.JpaSystemException;
@ -67,7 +67,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTestWithClean
@Autowired
JpaAttempt jpaAttempt;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -11,7 +11,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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 jakarta.persistence.EntityManager;
@ -46,7 +46,7 @@ class HsOfficePersonRbacRepositoryIntegrationTest extends ContextBasedTestWithCl
@Autowired
JpaAttempt jpaAttempt;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -10,7 +10,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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 jakarta.persistence.EntityManager;
@ -44,7 +44,7 @@ class HsOfficePersonRealRepositoryIntegrationTest extends ContextBasedTestWithCl
@Autowired
JpaAttempt jpaAttempt;
@MockBean
@MockitoBean
HttpServletRequest request;
@Autowired
private HsOfficePersonRealRepository hsOfficePersonRealRepository;

View File

@ -9,7 +9,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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 jakarta.persistence.EntityManager;
@ -35,7 +35,7 @@ class HsOfficeRealRelationRepositoryIntegrationTest extends ContextBasedTestWith
@PersistenceContext
EntityManager em;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.jpa.JpaSystemException;
@ -58,7 +58,7 @@ class HsOfficeRelationRepositoryIntegrationTest extends ContextBasedTestWithClea
@Autowired
JpaAttempt jpaAttempt;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -13,7 +13,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.jpa.JpaSystemException;
@ -55,7 +55,7 @@ class HsOfficeSepaMandateRepositoryIntegrationTest extends ContextBasedTestWithC
@PersistenceContext
EntityManager em;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -8,7 +8,7 @@ import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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.test.annotation.DirtiesContext;
import org.springframework.transaction.annotation.Transactional;
@ -27,7 +27,7 @@ class ContextIntegrationTests {
@Autowired
private Context context;
@MockBean
@MockitoBean
@SuppressWarnings("unused") // the bean must be present, even though it's not used directly
private HttpServletRequest request;

View File

@ -10,7 +10,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.jpa.JpaSystemException;
import org.springframework.transaction.annotation.Propagation;
@ -32,7 +32,7 @@ class RbacGrantRepositoryIntegrationTest extends ContextBasedTest {
@Autowired
Context context;
@MockBean
@MockitoBean
HttpServletRequest request;
@Autowired

View File

@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.springframework.beans.factory.annotation.Autowired;
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 jakarta.servlet.http.HttpServletRequest;
@ -28,7 +28,7 @@ class RbacGrantsDiagramServiceIntegrationTest extends ContextBasedTestWithCleanu
@Autowired
RbacGrantsDiagramService grantsMermaidService;
@MockBean
@MockitoBean
HttpServletRequest request;
@Autowired

View File

@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
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.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
@ -39,16 +39,16 @@ class RbacRoleControllerRestTest {
@Autowired
MockMvc mockMvc;
@MockBean
@MockitoBean
Context contextMock;
@MockBean
@MockitoBean
RbacRoleRepository rbacRoleRepository;
@MockBean
@MockitoBean
EntityManagerWrapper em;
@MockBean
@MockitoBean
EntityManagerFactory emf;
@BeforeEach

View File

@ -7,7 +7,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.jpa.JpaSystemException;
@ -31,7 +31,7 @@ class RbacRoleRepositoryIntegrationTest {
@Autowired
EntityManager em;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
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.test.context.bean.override.mockito.MockitoBean;
import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
@ -34,13 +34,13 @@ class RbacSubjectControllerRestTest {
@Autowired
MockMvc mockMvc;
@MockBean
@MockitoBean
Context contextMock;
@MockBean
@MockitoBean
RbacSubjectRepository rbacSubjectRepository;
@MockBean
@MockitoBean
EntityManagerWrapper em;

View File

@ -8,7 +8,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.jpa.JpaSystemException;
import org.springframework.transaction.annotation.Propagation;
@ -37,7 +37,7 @@ class RbacSubjectRepositoryIntegrationTest extends ContextBasedTest {
@PersistenceContext
EntityManager em;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -7,7 +7,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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 jakarta.persistence.PersistenceException;
@ -25,7 +25,7 @@ class TestCustomerRepositoryIntegrationTest extends ContextBasedTest {
@Autowired
TestCustomerRepository testCustomerRepository;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested

View File

@ -7,7 +7,7 @@ import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
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.orm.ObjectOptimisticLockingFailureException;
@ -31,7 +31,7 @@ class TestPackageRepositoryIntegrationTest extends ContextBasedTest {
@Autowired
JpaAttempt jpaAttempt;
@MockBean
@MockitoBean
HttpServletRequest request;
@Nested