Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions wallet-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,28 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<scope>provided</scope>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
22 changes: 22 additions & 0 deletions wallet-reward-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,28 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion wallet-reward-services/src/main/resources/jpa-entities.idx
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
io.meeds.wallet.reward.entity.WalletRewardEntity
io.meeds.wallet.reward.entity.WalletRewardPeriodEntity
io.meeds.wallet.reward.entity.WalletRewardEntity
io.meeds.wallet.reward.entity.WalletRewardPeriodSummaryEntity
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.mockito.MockedStatic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

import org.exoplatform.services.listener.Event;
import org.exoplatform.services.listener.ListenerService;
Expand All @@ -44,19 +44,19 @@
@SpringBootTest(classes = { RewardReportUpdateListener.class, })
class RewardReportUpdateListenerTest {

@MockBean
@MockitoBean
private WalletRewardReportService rewardReportService;

@MockBean
@MockitoBean
private RewardSettingsService rewardSettingsService;

@MockBean
@MockitoBean
private ListenerService listenerService;

@MockBean
@MockitoBean
private RealizationService realizationService;

@MockBean
@MockitoBean
private Event<Object, Map<String, String>> event;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

import org.exoplatform.services.listener.Event;
import org.exoplatform.services.listener.ListenerService;
Expand All @@ -45,10 +45,10 @@
@SpringBootTest(classes = { RewardSucceedAnalyticsListener.class, })
class RewardSucceedAnalyticsListenerTest {

@MockBean
@MockitoBean
private ListenerService listenerService;

@MockBean
@MockitoBean
private Event<RewardReport, Object> event;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

import org.exoplatform.commons.api.notification.NotificationContext;
import org.exoplatform.commons.api.notification.model.PluginKey;
Expand All @@ -45,16 +45,16 @@ class RewardSucceedNotificationListenerTest {

private static final String EVENT_NAME = "exo.wallet.reward.report.success";

@MockBean
@MockitoBean
private Event<RewardReport, Object> event;

@MockBean
@MockitoBean
private RewardReport rewardReport;

@MockBean
@MockitoBean
private NotificationContext notificationContext;

@MockBean
@MockitoBean
private ListenerService listenerService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

import org.exoplatform.services.listener.Event;
import org.exoplatform.services.listener.ListenerService;
Expand All @@ -39,13 +39,13 @@ class TransactionReplacedListenerTest {

private static final String EVENT_NAME = "exo.wallet.transaction.replaced";

@MockBean
@MockitoBean
private ListenerService listenerService;

@MockBean
@MockitoBean
private RewardReportService rewardReportService;

@MockBean
@MockitoBean
private Event<Object, Map<String, String>> event;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureWebMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.http.MediaType;
Expand Down Expand Up @@ -97,10 +97,10 @@ class TestRewardReportREST {
OBJECT_MAPPER.registerModule(new JavaTimeModule());
}

@MockBean
@MockitoBean
private RewardReportService rewardReportService;

@MockBean
@MockitoBean
private RewardSettingsService rewardSettingsService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureWebMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.http.MediaType;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.web.SecurityFilterChain;
Expand Down Expand Up @@ -91,7 +91,7 @@ class TestRewardSettingsREST {
OBJECT_MAPPER.registerModule(new JavaTimeModule());
}

@MockBean
@MockitoBean
private RewardSettingsService rewardSettingsService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import static org.mockito.Mockito.*;

@SpringBootTest(classes = { RewardReportUpdateTask.class })
class RewardReportUpdateTaskTest {

@MockBean
@MockitoBean
private RewardReportService rewardReportService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

import static io.meeds.wallet.utils.RewardUtils.REWARD_SUCCESS_EVENT_NAME;
import static org.mockito.Mockito.*;

@SpringBootTest(classes = { RewardStatusVerifierTask.class })
class RewardStatusVerifierTaskTest {

@MockBean
@MockitoBean
private RewardReportService rewardReportService;

@MockBean
@MockitoBean
private WalletAccountService walletAccountService;

@MockBean
@MockitoBean
private ListenerService listenerService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;

Expand All @@ -69,22 +69,22 @@ public class WalletRewardReportServiceTest { // NOSONAR

private static final Pageable PAGEABLE = Pageable.ofSize(2);

@MockBean
@MockitoBean
private WalletAccountService walletAccountService;

@MockBean
@MockitoBean
private WalletTokenAdminService walletTokenAdminService;

@MockBean
@MockitoBean
private RewardSettingsService rewardSettingsService;

@MockBean
@MockitoBean
private WalletRewardReportStorage rewardReportStorage;

@MockBean
@MockitoBean
private RealizationService realizationService;

@MockBean
@MockitoBean
private ResourceBundleService resourceBundleService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

import static io.meeds.wallet.utils.WalletUtils.toJsonString;
import static org.junit.jupiter.api.Assertions.*;
Expand All @@ -41,10 +41,10 @@
@SpringBootTest(classes = { WalletRewardSettingsService.class })
public class WalletRewardSettingsServiceTest {

@MockBean
@MockitoBean
private SettingService settingService;

@MockBean
@MockitoBean
private ListenerService listenerService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
Expand All @@ -64,19 +64,19 @@ class WalletRewardReportStorageTest {

private static final Pageable PAGEABLE = Pageable.ofSize(2);

@MockBean
@MockitoBean
private RewardDAO rewardDAO;

@MockBean
@MockitoBean
private RewardPeriodDAO rewardPeriodDAO;

@MockBean
@MockitoBean
private RewardPeriodSummaryDAO rewardPeriodSummaryDAO;

@MockBean
@MockitoBean
private WalletAccountService walletAccountService;

@MockBean
@MockitoBean
private WalletTransactionService walletTransactionService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package io.meeds.wallet;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration;
import org.springframework.boot.liquibase.autoconfigure.LiquibaseAutoConfiguration;
import org.springframework.context.annotation.PropertySource;

import io.meeds.spring.AvailableIntegration;
Expand Down
Loading