use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class LocalDateConverterFactoryTest method testWrongBeanValues.
@Test(expectedExceptions = ClassCastException.class)
public void testWrongBeanValues(@Mocked BeanRepository beanRepository) throws ValueConverterException {
// Given
Converters converters = new Converters(beanRepository);
// When
Converter converter = converters.getConverter(LocalDate.class);
// Then
converter.convertToDolphin(7);
}
use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class LocalDateTimeConverterFactoryTest method testNullValues.
@Test
public void testNullValues(@Mocked BeanRepository beanRepository) {
// Given
Converters converters = new Converters(beanRepository);
// When
Converter converter = converters.getConverter(LocalDateTime.class);
// Then
try {
assertEquals(converter.convertFromDolphin(null), null);
assertEquals(converter.convertToDolphin(null), null);
} catch (ValueConverterException e) {
fail("Error in conversion", e);
}
}
use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class PeriodeConverterFactoryTest method testWrongDolphinValues.
@Test(expectedExceptions = ClassCastException.class)
public void testWrongDolphinValues(@Mocked BeanRepository beanRepository) throws ValueConverterException {
// Given
Converters converters = new Converters(beanRepository);
// When
Converter converter = converters.getConverter(Period.class);
// Then
converter.convertFromDolphin(7);
}
use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class PeriodeConverterFactoryTest method testFactoryFieldType.
@Test
public void testFactoryFieldType(@Mocked BeanRepository beanRepository) {
// Given
Converters converters = new Converters(beanRepository);
// When
int type = converters.getFieldType(Period.class);
// Then
assertEquals(type, ValueFieldTypes.PERIODE_FIELD_TYPE);
}
use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class ZonedDateTimeConverterFactoryTest method testConverterCreation.
@Test
public void testConverterCreation(@Mocked BeanRepository beanRepository) {
// Given
Converters converters = new Converters(beanRepository);
// When
Converter converter = converters.getConverter(ZonedDateTime.class);
// Then
assertNotNull(converter);
}
Aggregations