#320 fixing JodaTime unit test

This commit is contained in:
sjaakd 2015-03-08 21:33:46 +01:00
parent bacf835c0d
commit 229537284a
3 changed files with 5 additions and 8 deletions

View File

@ -37,7 +37,7 @@ public abstract class AbstractJodaTypeToStringConversion extends SimpleConversio
@Override
protected String getToExpression(ConversionContext conversionContext) {
return conversionString( conversionContext, "print" );
return conversionString( conversionContext, "print" ) + ".trim()";
}
@Override

View File

@ -107,10 +107,10 @@ public class JodaConversionTest {
// and now with default mappings
target = SourceTargetMapper.INSTANCE.sourceToTargetDefaultMapping( src );
assertThat( target ).isNotNull();
assertThat( target.getDateTime() ).isEqualTo( "01.01.2014 00:00 UTC" );
assertThat( target.getLocalDateTime() ).isEqualTo( "01.01.2014 00:00" );
assertThat( target.getLocalDate() ).isEqualTo( "01.01.2014" );
assertThat( target.getLocalTime() ).isEqualTo( "00:00" );
assertThat( target.getDateTime() ).isEqualTo( "1. Januar 2014 00:00:00 UTC" );
assertThat( target.getLocalDateTime() ).isEqualTo( "1. Januar 2014 00:00:00" );
assertThat( target.getLocalDate() ).isEqualTo( "1. Januar 2014" );
assertThat( target.getLocalTime() ).isEqualTo( "00:00:00" );
}
@Test

View File

@ -18,7 +18,6 @@
*/
package org.mapstruct.ap.test.conversion.jodatime;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
@ -45,7 +44,6 @@ public interface SourceTargetMapper {
})
Target sourceToTarget(Source source);
@InheritInverseConfiguration( name = "targetToSource" ) // TODO: FIXME
Target sourceToTargetDefaultMapping(Source source);
@Mapping(target = "dateTime", dateFormat = DATE_TIME_FORMAT)
@ -80,6 +78,5 @@ public interface SourceTargetMapper {
@Mapping(target = "localTime", dateFormat = LOCAL_TIME_FORMAT)
Source targetToSourceLocalTimeMapped(Target target);
@InheritInverseConfiguration( name = "sourceToTarget" ) // TODO: FIXME
Source targetToSourceDefaultMapping(Target target);
}