/** * Creates a new instance of <code>{@link io.zeebe.exporter.record.value.MessageRecordValueAssert}</code>. * * @param actual the actual value. * @return the created assertion object. */ @org.assertj.core.util.CheckReturnValue public static io.zeebe.exporter.record.value.MessageRecordValueAssert assertThat(io.zeebe.exporter.record.value.MessageRecordValue actual) { return new io.zeebe.exporter.record.value.MessageRecordValueAssert(actual); }
@Test public void shouldDeleteMessageImmediatelyWithZeroTTL() { // given final ExecuteCommandResponse response = apiRule .createCmdRequest() .type(ValueType.MESSAGE, PUBLISH) .command() .put("name", "order canceled") .put("correlationKey", "order-123") .put("timeToLive", 0L) .done() .sendAndAwait(); // when brokerRule.getClock().addTime(MessageObserver.MESSAGE_TIME_TO_LIVE_CHECK_INTERVAL); // then final Record<MessageRecordValue> deletedEvent = testClient.receiveFirstMessageEvent(MessageIntent.DELETED); assertThat(deletedEvent.getKey()).isEqualTo(response.getKey()); assertThat(MsgPackUtil.asMsgPackReturnArray(deletedEvent.getValue().getPayload())) .isEqualTo(EMTPY_OBJECT); Assertions.assertThat(deletedEvent.getValue()) .hasName("order canceled") .hasCorrelationKey("order-123") .hasTimeToLive(0L) .hasMessageId(""); }
@Test public void shouldDeleteMessageImmediatelyWithZeroTTL() { // given final ExecuteCommandResponse response = apiRule .createCmdRequest() .type(ValueType.MESSAGE, PUBLISH) .command() .put("name", "order canceled") .put("correlationKey", "order-123") .put("timeToLive", 0L) .done() .sendAndAwait(); // when brokerRule.getClock().addTime(MessageObserver.MESSAGE_TIME_TO_LIVE_CHECK_INTERVAL); // then final Record<MessageRecordValue> deletedEvent = testClient.receiveFirstMessageEvent(MessageIntent.DELETED); assertThat(deletedEvent.getKey()).isEqualTo(response.getKey()); assertThat(MsgPackUtil.asMsgPackReturnArray(deletedEvent.getValue().getPayload())) .isEqualTo(EMTPY_OBJECT); Assertions.assertThat(deletedEvent.getValue()) .hasName("order canceled") .hasCorrelationKey("order-123") .hasTimeToLive(0L) .hasMessageId(""); }
.hasName("order canceled") .hasCorrelationKey("order-123") .hasTimeToLive(100L) .hasMessageId("");
/** * An entry point for MessageRecordValueAssert to follow AssertJ standard <code>assertThat()</code> statements.<br> * With a static import, one can write directly: <code>assertThat(myMessageRecordValue)</code> and get specific assertion with code completion. * @param actual the MessageRecordValue we want to make assertions on. * @return a new <code>{@link MessageRecordValueAssert}</code> */ @org.assertj.core.util.CheckReturnValue public static MessageRecordValueAssert assertThat(MessageRecordValue actual) { return new MessageRecordValueAssert(actual); } }
.hasName("order canceled") .hasCorrelationKey("order-123") .hasTimeToLive(100L) .hasMessageId("");