完成单机TEST统一入口与可靠投递回归收尾

This commit is contained in:
2026-09-29 19:48:34 +08:00
parent 64a70c9f28
commit 6c0a026cc4
89 changed files with 968 additions and 983 deletions
@@ -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"}) {