优化
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
package com.baiyue.common.event;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class OverseasDeliveryCompletedV1Test {
|
||||
private final ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule());
|
||||
|
||||
@Test
|
||||
void roundTripsStableSourceIdentifiers() throws Exception {
|
||||
var value = new OverseasDeliveryCompletedV1("31", "DL-31", "41", "LM-41", "51",
|
||||
"NYEXX2609080022", "61", "FL-61", "61", "ACY2",
|
||||
Instant.parse("2026-09-15T08:00:00Z"));
|
||||
|
||||
var restored = mapper.readValue(mapper.writeValueAsBytes(value), OverseasDeliveryCompletedV1.class);
|
||||
|
||||
assertThat(restored).isEqualTo(value);
|
||||
assertThat(restored.sourceInboundId()).isEqualTo("51");
|
||||
assertThat(restored.sourceOrderId()).isEqualTo("61");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user