Java Code Examples for com.fasterxml.jackson.databind.PropertyNamingStrategy#LowerCaseWithUnderscoresStrategy

The following examples show how to use com.fasterxml.jackson.databind.PropertyNamingStrategy#LowerCaseWithUnderscoresStrategy . 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: Jackson2ObjectMapperBuilderTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void propertyNamingStrategy() {
	PropertyNamingStrategy strategy = new PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy();
	ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().propertyNamingStrategy(strategy).build();
	assertSame(strategy, objectMapper.getSerializationConfig().getPropertyNamingStrategy());
	assertSame(strategy, objectMapper.getDeserializationConfig().getPropertyNamingStrategy());
}
 
Example 2
Source File: Jackson2ObjectMapperFactoryBeanTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void propertyNamingStrategy() {
	PropertyNamingStrategy strategy = new PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy();
	this.factory.setPropertyNamingStrategy(strategy);
	this.factory.afterPropertiesSet();

	assertSame(strategy, this.factory.getObject().getSerializationConfig().getPropertyNamingStrategy());
	assertSame(strategy, this.factory.getObject().getDeserializationConfig().getPropertyNamingStrategy());
}
 
Example 3
Source File: Jackson2ObjectMapperBuilderTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void propertyNamingStrategy() {
	PropertyNamingStrategy strategy = new PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy();
	ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().propertyNamingStrategy(strategy).build();
	assertSame(strategy, objectMapper.getSerializationConfig().getPropertyNamingStrategy());
	assertSame(strategy, objectMapper.getDeserializationConfig().getPropertyNamingStrategy());
}
 
Example 4
Source File: Jackson2ObjectMapperFactoryBeanTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void propertyNamingStrategy() {
	PropertyNamingStrategy strategy = new PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy();
	this.factory.setPropertyNamingStrategy(strategy);
	this.factory.afterPropertiesSet();

	assertSame(strategy, this.factory.getObject().getSerializationConfig().getPropertyNamingStrategy());
	assertSame(strategy, this.factory.getObject().getDeserializationConfig().getPropertyNamingStrategy());
}
 
Example 5
Source File: Jackson2ObjectMapperBuilderTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void propertyNamingStrategy() {
	PropertyNamingStrategy strategy = new PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy();
	ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().propertyNamingStrategy(strategy).build();
	assertSame(strategy, objectMapper.getSerializationConfig().getPropertyNamingStrategy());
	assertSame(strategy, objectMapper.getDeserializationConfig().getPropertyNamingStrategy());
}
 
Example 6
Source File: Jackson2ObjectMapperFactoryBeanTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void propertyNamingStrategy() {
	PropertyNamingStrategy strategy = new PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy();
	this.factory.setPropertyNamingStrategy(strategy);
	this.factory.afterPropertiesSet();

	assertSame(strategy, this.factory.getObject().getSerializationConfig().getPropertyNamingStrategy());
	assertSame(strategy, this.factory.getObject().getDeserializationConfig().getPropertyNamingStrategy());
}