mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#320 fixing JodaTime unit test
This commit is contained in:
parent
bacf835c0d
commit
229537284a
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user