mirror of
https://github.com/valitydev/adapter-common-lib.git
synced 2024-11-06 02:05:18 +00:00
Set deprecated field as unwrapped
This commit is contained in:
parent
6c6de48d53
commit
e85fd17343
@ -2,6 +2,7 @@ package com.rbkmoney.adapter.common.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonUnwrapped;
|
||||
import com.rbkmoney.adapter.common.enums.Step;
|
||||
import lombok.Data;
|
||||
|
||||
@ -21,6 +22,7 @@ public class AdapterContext {
|
||||
|
||||
private Step step;
|
||||
|
||||
@JsonUnwrapped
|
||||
private PollingInfo pollingInfo;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.rbkmoney.adapter.common.model;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class AdapterContextTest {
|
||||
|
||||
@Test
|
||||
public void testUnwrapped() throws JsonProcessingException {
|
||||
ObjectMapper om = new ObjectMapper();
|
||||
AdapterContext ac = new AdapterContext();
|
||||
ac.setMd("kek");
|
||||
PollingInfo pollingInfo = new PollingInfo();
|
||||
pollingInfo.setMaxDateTimePolling(Instant.now());
|
||||
ac.setPollingInfo(pollingInfo);
|
||||
String str = om.writeValueAsString(ac);
|
||||
assertTrue(str.startsWith("{\"md\":\"kek\",\"max_date_time_polling\":"));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user