Code example for DefaultFormattingConversionService

0
import org.springframework.core.convert.support.GenericConversionService;
import org.springframework.format.support.DefaultFormattingConversionService;
 
public class BooleanFilterTest { 
 
	private static final GenericConversionService genericConversionService = new DefaultFormattingConversionService();
 
	@Test
	public void testFalseFilter() { 
		BooleanFilter filter = new BooleanFilter("field", false, null, null);
		assertThat(filter.getValue()).isEqualTo(false);
		assertThat(filter.getField()).isEqualTo("field");
		assertThat(filter.getRawComparison()).isNull();
		assertThat(filter.getComparison()).isNull();
	} 
 
	@Test
	public void testTrueFilter() { 
		BooleanFilter filter = new BooleanFilter("xy", true, null, null);
		assertThat(filter.getValue()).isEqualTo(true);