mirror of
https://github.com/valitydev/hooker.git
synced 2024-11-06 00:05:17 +00:00
Up damsel (#54)
This commit is contained in:
parent
ccbcf02a00
commit
94992dbb2c
@ -1,6 +1,5 @@
|
||||
package dev.vality.hooker.utils;
|
||||
|
||||
import dev.vality.damsel.user_interaction.UserInteraction;
|
||||
import dev.vality.damsel.webhooker.*;
|
||||
import dev.vality.hooker.dao.WebhookAdditionalFilter;
|
||||
import dev.vality.hooker.model.EventType;
|
||||
@ -112,6 +111,16 @@ public class EventFilterUtils {
|
||||
.invoice_payment_refund_change(InvoicePaymentRefundChange
|
||||
.invoice_payment_refund_status_changed(invoicePaymentRefundStatusChanged))));
|
||||
break;
|
||||
case INVOICE_PAYMENT_USER_INTERACTION_CHANGE_REQUESTED:
|
||||
invoiceEventTypes.add(InvoiceEventType.payment(InvoicePaymentEventType
|
||||
.user_interaction(new InvoicePaymentUserInteractionChange(
|
||||
UserInteractionStatus.requested(new UserInteractionStatusRequested())))));
|
||||
break;
|
||||
case INVOICE_PAYMENT_USER_INTERACTION_CHANGE_COMPLETED:
|
||||
invoiceEventTypes.add(InvoiceEventType.payment(InvoicePaymentEventType
|
||||
.user_interaction(new InvoicePaymentUserInteractionChange(
|
||||
UserInteractionStatus.completed(new UserInteractionStatusCompleted())))));
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException(
|
||||
"Unknown event code " + eventTypeCode + "; must be one of these: " +
|
||||
|
@ -15,7 +15,7 @@ import java.util.HashSet;
|
||||
public class EventFilterUtilsTest {
|
||||
@Test
|
||||
public void getEventFilterByCode() throws Exception {
|
||||
Assert.assertEquals(getEventFilter().getInvoice().getTypes().size(), 6);
|
||||
Assert.assertEquals(getEventFilter().getInvoice().getTypes().size(), 8);
|
||||
Assert.assertEquals(getCustomerEventFilter().getCustomer().getTypes().size(), 6);
|
||||
}
|
||||
|
||||
@ -32,6 +32,14 @@ public class EventFilterUtilsTest {
|
||||
eventTypeCodeSet
|
||||
.add(WebhookAdditionalFilter.builder().eventType(EventType.INVOICE_PAYMENT_REFUND_STATUS_CHANGED)
|
||||
.build());
|
||||
eventTypeCodeSet
|
||||
.add(WebhookAdditionalFilter.builder()
|
||||
.eventType(EventType.INVOICE_PAYMENT_USER_INTERACTION_CHANGE_REQUESTED)
|
||||
.build());
|
||||
eventTypeCodeSet
|
||||
.add(WebhookAdditionalFilter.builder()
|
||||
.eventType(EventType.INVOICE_PAYMENT_USER_INTERACTION_CHANGE_COMPLETED)
|
||||
.build());
|
||||
return EventFilterUtils.getEventFilter(eventTypeCodeSet);
|
||||
}
|
||||
|
||||
@ -49,7 +57,7 @@ public class EventFilterUtilsTest {
|
||||
|
||||
@Test
|
||||
public void getWebhookAdditionalFilter() throws Exception {
|
||||
Assert.assertEquals(EventFilterUtils.getWebhookAdditionalFilter(getEventFilter()).size(), 6);
|
||||
Assert.assertEquals(EventFilterUtils.getWebhookAdditionalFilter(getEventFilter()).size(), 8);
|
||||
Assert.assertEquals(EventFilterUtils.getWebhookAdditionalFilter(getCustomerEventFilter()).size(), 6);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user