Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karle0wne committed Oct 26, 2024
1 parent fb2114f commit c320e7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import dev.vality.disputes.schedule.model.ProviderData;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;

Expand All @@ -20,13 +21,16 @@
@SuppressWarnings({"ParameterName", "LineLength"})
public class DummyRemoteClientImpl implements DefaultRemoteClient {

private final String routeUrl = "tg-bot";

@Override
public Boolean routeUrlEquals(ProviderData providerData) {
return false; // todo
return StringUtils.equalsIgnoreCase(providerData.getRouteUrl(), routeUrl);
}

@Override
public DisputeCreatedResult createDispute(Dispute dispute, List<Attachment> attachments, ProviderData providerData) {
providerData.setRouteUrl(routeUrl);
return DisputeCreatedResult.successResult(new DisputeCreatedSuccessResult(UUID.randomUUID().toString()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void testNoAttachments() {

@Test
@SneakyThrows
public void testManualCreatedWhenIsNotProvidersDisputesApiExist() {
public void testManualPendingWhenIsNotProvidersDisputesApiExist() {
var invoiceId = "20McecNnWoy";
var paymentId = "1";
var disputeId = UUID.fromString(disputeApiTestService.createDisputeViaApi(invoiceId, paymentId).getDisputeId());
Expand All @@ -105,7 +105,7 @@ public void testManualCreatedWhenIsNotProvidersDisputesApiExist() {
when(dominantService.getProxy(any())).thenReturn(createProxy().get());
var dispute = disputeDao.get(disputeId);
createdDisputesService.callCreateDisputeRemotely(dispute.get());
assertEquals(DisputeStatus.manual_created, disputeDao.get(disputeId).get().getStatus());
assertEquals(DisputeStatus.manual_pending, disputeDao.get(disputeId).get().getStatus());
disputeDao.update(disputeId, DisputeStatus.failed);
}

Expand Down

0 comments on commit c320e7a

Please sign in to comment.