Code example for DefaultConversionService

0
    public void setup() { 
         
        Set<GenericConverter> converters = new HashSet<GenericConverter>();
        converters.add(new BindingConverter());
         
        svc = new DefaultConversionService();
        ConversionServiceFactory.registerConverters(converters, svc);
    } 
     
    /** 
     * Test to prove that Jadira Convert can be invoked via Spring 
     */ 
    @Test
    public void testBindingConverter() { 
        assertEquals(new SubjectC("String"), svc.convert("String:String", SubjectC.class));
    } 
} 
Experience pair programming with AI  Get Codota for Java