mirror of
https://github.com/valitydev/hooker.git
synced 2024-11-06 00:05:17 +00:00
Logging parent Id (#25)
* Fix parent Id * Fix test * logging parent_id Co-authored-by: Inal Arsanukaev <aiz@empayre.com>
This commit is contained in:
parent
cc9a3d69a3
commit
500f734626
4
pom.xml
4
pom.xml
@ -173,12 +173,12 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
<version>4.3</version>
|
||||
<version>4.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>29.0-jre</version>
|
||||
<version>31.1-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
|
@ -30,7 +30,7 @@ public class MessageService<T extends Message> {
|
||||
Long hookId = w.getHookId();
|
||||
Long parentEventId = messageDao.getParentId(hookId, sourceId, id);
|
||||
WebhookMessage webhookMessage = webhookMessageBuilder.build(w, event, sourceId, parentEventId);
|
||||
log.info("Try to send webhook to kafka: {}", webhookMessage);
|
||||
log.info("Try to send webhook to kafka: {}, parentId {}", webhookMessage, parentEventId);
|
||||
webhookKafkaProducerService.send(webhookMessage);
|
||||
log.info("Webhook to kafka was sent: sourceId={}", webhookMessage.getSourceId());
|
||||
});
|
||||
|
@ -9,6 +9,7 @@ import dev.vality.swag_webhook_events.model.CustomerPayer;
|
||||
import dev.vality.swag_webhook_events.model.Payment;
|
||||
import dev.vality.swag_webhook_events.model.PaymentResourcePayer;
|
||||
import dev.vality.swag_webhook_events.model.RecurrentPayer;
|
||||
import org.junit.jupiter.api.RepeatedTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
@ -31,16 +32,19 @@ public class PaymentConverterTest {
|
||||
@Autowired
|
||||
private PaymentConverter converter;
|
||||
|
||||
@Test
|
||||
@RepeatedTest(7)
|
||||
public void testConvert() throws IOException {
|
||||
MockTBaseProcessor mockTBaseProcessor = new MockTBaseProcessor(MockMode.RANDOM, 15, 1);
|
||||
InvoicePayment source = mockTBaseProcessor
|
||||
.process(new InvoicePayment(), new TBaseHandler<>(InvoicePayment.class));
|
||||
source.setCreatedAt("2016-03-22T06:12:27Z");
|
||||
PaymentTool paymentTool = PaymentTool
|
||||
.bank_card(mockTBaseProcessor.process(new BankCard(), new TBaseHandler<>(BankCard.class)));
|
||||
if (source.getPayer().isSetPaymentResource()) {
|
||||
source.getPayer().getPaymentResource().getResource()
|
||||
.setPaymentTool(PaymentTool
|
||||
.bank_card(mockTBaseProcessor.process(new BankCard(), new TBaseHandler<>(BankCard.class))));
|
||||
.setPaymentTool(paymentTool);
|
||||
} else if (source.getPayer().isSetCustomer()) {
|
||||
source.getPayer().getCustomer().setPaymentTool(paymentTool);
|
||||
}
|
||||
source.setStatus(InvoicePaymentStatus.pending(new InvoicePaymentPending()));
|
||||
Payment target = converter
|
||||
|
Loading…
Reference in New Issue
Block a user