org.springframework.boot.test.json.JacksonTester Java Examples

The following examples show how to use org.springframework.boot.test.json.JacksonTester. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ComplexWidgetTest.java    From find with MIT License 5 votes vote down vote up
@Override
public void setUp() {
    final SimpleModule simpleModule = new SimpleModule();
    simpleModule.addSerializer(TagName.class, new TagNameSerializer());
    objectMapper.registerModule(simpleModule);
    objectMapper.addMixIn(WidgetDatasource.class, WidgetDatasourceMixins.class);
    objectMapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE);
    objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);

    json = new JacksonTester<>(getClass(), ResolvableType.forClass(getType()), objectMapper);
}
 
Example #2
Source File: DashboardTest.java    From find with MIT License 5 votes vote down vote up
@Override
public void setUp() {
    final SimpleModule simpleModule = new SimpleModule();
    simpleModule.addSerializer(TagName.class, new TagNameSerializer());
    objectMapper.registerModule(simpleModule);
    objectMapper.addMixIn(Widget.class, WidgetMixins.class);
    objectMapper.addMixIn(WidgetDatasource.class, WidgetDatasourceMixins.class);
    json = new JacksonTester<>(getClass(), ResolvableType.forClass(getType()), objectMapper);
}
 
Example #3
Source File: AbstractTest.java    From spring-cloud-contract-samples with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
	ObjectMapper objectMappper = new ObjectMapper();
	// Possibly configure the mapper
	JacksonTester.initFields(this, objectMappper);
}
 
Example #4
Source File: IntoxicationControllerTest.java    From spring-cloud-contract-samples with Apache License 2.0 5 votes vote down vote up
@BeforeEach
void setUp() {
	this.intoxicationController.port = this.producerPort;
	ObjectMapper objectMappper = new ObjectMapper();
	// Possibly configure the mapper
	JacksonTester.initFields(this, objectMappper);
}
 
Example #5
Source File: EndpointMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #6
Source File: TrendingConfigurationTest.java    From find with MIT License 4 votes vote down vote up
@Override
public void setUp() {
    json = new JacksonTester<>(getClass(), ResolvableType.forClass(getType()), objectMapper);
}
 
Example #7
Source File: UiCustomizationTest.java    From find with MIT License 4 votes vote down vote up
@Override
public void setUp() {
    json = new JacksonTester<>(getClass(), ResolvableType.forClass(getType()), objectMapper);
}
 
Example #8
Source File: TemplatesConfigTest.java    From find with MIT License 4 votes vote down vote up
@Override
public void setUp() {
    json = new JacksonTester<>(getClass(), ResolvableType.forClass(getType()), objectMapper);
}
 
Example #9
Source File: InstanceStatusChangedEventMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #10
Source File: InstanceRegisteredEventMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #11
Source File: StatusInfoMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #12
Source File: DatasourceDependentWidgetTest.java    From find with MIT License 4 votes vote down vote up
@Override
public void setUp() {
    final ObjectMapper objectMapper = new ObjectMapper();
    objectMapper.addMixIn(WidgetDatasource.class, WidgetDatasourceMixins.class);
    json = new JacksonTester<>(getClass(), ResolvableType.forClass(getType()), objectMapper);
}
 
Example #13
Source File: InfoMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #14
Source File: InstanceInfoChangedEventMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #15
Source File: InstanceEndpointsDetectedEventMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #16
Source File: InstanceRegistrationUpdatedEventMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #17
Source File: TagsMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #18
Source File: EndpointsMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #19
Source File: InstanceDeregisteredEventMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #20
Source File: InstanceEventMixinTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
	JacksonTester.initFields(this, objectMapper);
}
 
Example #21
Source File: TestCustomerJsonSerializing.java    From Spring with Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
	ObjectMapper objectMapper = new ObjectMapper();
	JacksonTester.initFields(this, objectMapper);
}
 
Example #22
Source File: AbstractTest.java    From spring-cloud-contract-samples with Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
	ObjectMapper objectMappper = new ObjectMapper();
	// Possibly configure the mapper
	JacksonTester.initFields(this, objectMappper);
}
 
Example #23
Source File: AbstractTest.java    From spring-cloud-contract-samples with Apache License 2.0 4 votes vote down vote up
@Before
public void setup() throws IOException {
	ObjectMapper objectMappper = new ObjectMapper();
	// Possibly configure the mapper
	JacksonTester.initFields(this, objectMappper);
}
 
Example #24
Source File: AbstractTest.java    From spring-cloud-contract-samples with Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
	ObjectMapper objectMappper = new ObjectMapper();
	// Possibly configure the mapper
	JacksonTester.initFields(this, objectMappper);
}
 
Example #25
Source File: AbstractTest.java    From spring-cloud-contract-samples with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setup() {
    ObjectMapper objectMappper = new ObjectMapper();
    // Possibly configure the mapper
    JacksonTester.initFields(this, objectMappper);
}
 
Example #26
Source File: AbstractTest.java    From spring-cloud-contract-samples with Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
	ObjectMapper objectMappper = new ObjectMapper();
	// Possibly configure the mapper
	JacksonTester.initFields(this, objectMappper);
}
 
Example #27
Source File: ProducerControllerTests.java    From spring-cloud-contract-samples with Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
	ObjectMapper objectMappper = new ObjectMapper();
	// Possibly configure the mapper
	JacksonTester.initFields(this, objectMappper);
}
 
Example #28
Source File: ProducerControllerTests.java    From spring-cloud-contract-samples with Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
	ObjectMapper objectMappper = new ObjectMapper();
	// Possibly configure the mapper
	JacksonTester.initFields(this, objectMappper);
}
 
Example #29
Source File: AbstractTest.java    From spring-cloud-contract-samples with Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
	ObjectMapper objectMappper = new ObjectMapper();
	// Possibly configure the mapper
	JacksonTester.initFields(this, objectMappper);
}
 
Example #30
Source File: AbstractTest.java    From spring-cloud-contract-samples with Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
	ObjectMapper objectMappper = new ObjectMapper();
	// Possibly configure the mapper
	JacksonTester.initFields(this, objectMappper);
}