use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class PeriodeConverterFactoryTest method testNullValues.
@Test
public void testNullValues(@Mocked BeanRepository beanRepository) {
// Given
Converters converters = new Converters(beanRepository);
// When
Converter converter = converters.getConverter(Period.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 testConverterCreation.
@Test
public void testConverterCreation(@Mocked BeanRepository beanRepository) {
// Given
Converters converters = new Converters(beanRepository);
// When
Converter converter = converters.getConverter(Period.class);
// Then
assertNotNull(converter);
}
use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class PeriodeConverterFactoryTest method testBasicConversions.
@Test
public void testBasicConversions(@Mocked BeanRepository beanRepository) {
// Given
Converters converters = new Converters(beanRepository);
// When
Converter converter = converters.getConverter(Period.class);
// Then
testReconversion(converter, Period.ofDays(7));
testReconversion(converter, Period.ofYears(700_000_000));
testReconversion(converter, Period.ofWeeks(70_000_000));
testReconversion(converter, Period.ZERO);
testReconversion(converter, Period.ofDays(10_000_000));
}
use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class ZonedDateTimeConverterFactoryTest method testFactoryFieldType.
@Test
public void testFactoryFieldType(@Mocked BeanRepository beanRepository) {
// Given
Converters converters = new Converters(beanRepository);
// When
int type = converters.getFieldType(ZonedDateTime.class);
// Then
assertEquals(type, ValueFieldTypes.ZONED_DATE_TIME_FIELD_TYPE);
}
use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class ZonedDateTimeConverterFactoryTest method testNullValues.
@Test
public void testNullValues(@Mocked BeanRepository beanRepository) {
// Given
Converters converters = new Converters(beanRepository);
// When
Converter converter = converters.getConverter(ZonedDateTime.class);
// Then
try {
assertEquals(converter.convertFromDolphin(null), null);
assertEquals(converter.convertToDolphin(null), null);
} catch (ValueConverterException e) {
fail("Error in conversion", e);
}
}
Aggregations