public void LogErrorProducingOutboxStoredMessage_Logged() { var envelope = new OutboundEnvelope( null, new MessageHeaderCollection { { DefaultMessageHeaders.MessageType, "Message.Type" }, { DefaultMessageHeaders.MessageId, "1234" }, { KafkaMessageHeaders.KafkaMessageKey, "key1234" } }, new KafkaProducerEndpoint("test1"), true, new KafkaOffset("topic2", 2, 42)); var expectedMessage = "Failed to produce the message stored in the outbox. | " + "endpointName: test1, " + "messageType: Message.Type, " + "messageId: 1234, " + "offset: [2]@42, " + "kafkaKey: key1234"; _outboundLogger.LogErrorProducingOutboxStoredMessage(envelope, new InvalidOperationException()); _loggerSubstitute.Received( LogLevel.Error, typeof(InvalidOperationException), expectedMessage, 1077); }
public void LogErrorProducingOutboxStoredMessage_Logged() { var envelope = new OutboundEnvelope( null, new MessageHeaderCollection { { DefaultMessageHeaders.MessageType, "Message.Type" }, { DefaultMessageHeaders.MessageId, "1234" } }, new TestProducerEndpoint("test1"), true, new TestOffset("a", "42")); var expectedMessage = "Failed to produce the message stored in the outbox. | " + "endpointName: test1, " + "messageType: Message.Type, " + "messageId: 1234, " + "unused1: (null), " + "unused2: (null)"; _outboundLogger.LogErrorProducingOutboxStoredMessage(envelope, new InvalidOperationException()); _loggerSubstitute.Received( LogLevel.Error, typeof(InvalidOperationException), expectedMessage, 1077); }