完成单机TEST统一入口与可靠投递回归收尾
This commit is contained in:
@@ -5,6 +5,15 @@ import org.junit.jupiter.api.Test;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
class EventDeliveryObservationTest {
|
||||
@Test void malformedSuccessResponseIsNotReportedAsAnHttpSuccess() {
|
||||
var request = feign.Request.create(feign.Request.HttpMethod.POST, "http://consumer.invalid/events",
|
||||
java.util.Map.of(), new byte[0], java.nio.charset.StandardCharsets.UTF_8, new feign.RequestTemplate());
|
||||
var failure = new feign.codec.DecodeException(200, "secret remote payload", request);
|
||||
assertThat(EventDeliveryObservation.errorCode(failure, false, true)).isEqualTo("INVALID_RESPONSE");
|
||||
assertThat(EventDeliveryFailure.diagnostic(failure, "token"))
|
||||
.contains("Invalid consumer response contract").doesNotContain("secret", "HTTP 200");
|
||||
assertThat(EventDeliveryFailure.isPermanent(failure)).isFalse();
|
||||
}
|
||||
@Test void auditIdentitySupportsTheFormalUuidAndUlidContractWithoutSavingMalformedPayload() {
|
||||
var mapper = new ObjectMapper();
|
||||
for (String id : new String[]{"00000000-0000-4000-8000-000000000019", "01ARZ3NDEKTSV4RRFFQ69G5FAV"}) {
|
||||
|
||||
Reference in New Issue
Block a user