fix TimerProperties

This commit is contained in:
Anatoly Karlov 2024-08-26 21:11:11 +07:00
parent ad8b3e10d9
commit 8841105dc5
4 changed files with 38 additions and 2 deletions

View File

@ -250,6 +250,12 @@
<version>4.1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.vality</groupId>
<artifactId>testcontainers-annotations</artifactId>
<version>2.0.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>

View File

@ -1,7 +1,7 @@
package dev.vality.disputes.polling;
import dev.vality.adapter.flow.lib.model.PollingInfo;
import dev.vality.adapter.flow.lib.utils.TimerProperties;
import dev.vality.disputes.config.properties.DisputesTimerProperties;
import dev.vality.disputes.domain.tables.pojos.Dispute;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@ -18,7 +18,7 @@ import static dev.vality.disputes.utils.OptionsExtractors.extractMaxTimePolling;
@RequiredArgsConstructor
public class PollingInfoService {
private final TimerProperties timerProperties;
private final DisputesTimerProperties timerProperties;
public PollingInfo initPollingInfo(Dispute dispute, Map<String, String> options) {
return initPollingInfo(convert(dispute), options);

View File

@ -99,3 +99,7 @@ dispute:
time:
config:
max-time-polling-min: 600
testcontainers:
postgresql:
tag: '11.4'

View File

@ -0,0 +1,26 @@
package dev.vality.disputes.dao;
import dev.vality.disputes.domain.tables.pojos.Dispute;
import dev.vality.testcontainers.annotations.DefaultSpringBootTest;
import dev.vality.testcontainers.annotations.postgresql.PostgresqlTestcontainerSingleton;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import static dev.vality.testcontainers.annotations.util.RandomBeans.random;
import static org.junit.jupiter.api.Assertions.assertEquals;
@PostgresqlTestcontainerSingleton
@DefaultSpringBootTest
public class DisputeDaoTest {
@Autowired
private DisputeDao disputeDao;
@Test
public void insertAndFindAdjustmentEventTest() {
var random = random(Dispute.class);
disputeDao.save(random);
assertEquals(random,
disputeDao.get(random.getId(), random.getInvoiceId(), random.getPaymentId()));
}
}