You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I defined two entities as shown below
public static class A {
public String title;
public String content;
}
public static class B {
public String title;
public Integer lengthTitle;
public String content;
public Integer lengthContent;
}
Add test case @test
public void testScoringMatchingBug() throws Throwable {
MapperFactory factory = new DefaultMapperFactory.Builder().classMapBuilderFactory(new ScoringClassMapBuilder.Factory()).build();
ClassMap<A, B> map = factory.classMap(A.class, B.class).byDefault().toClassMap();
Map<String, String> mapping = new HashMap<>();
for (FieldMap f : map.getFieldsMapping()) {
mapping.put(f.getSource().getExpression(), f.getDestination().getExpression());
}
/*
* Check that properties we expect were mapped
*/
Assert.assertEquals("title", mapping.get("title"));
Assert.assertEquals("content", mapping.get("content"));
}
result
Unit test failed. Title is incorrectly mapped to lengthTitle and should be mapped to title first, content is the same
expect result
Unit test passed.
The text was updated successfully, but these errors were encountered:
I defined two entities as shown below
public static class A {
public String title;
public String content;
}
public static class B {
public String title;
public Integer lengthTitle;
public String content;
public Integer lengthContent;
}
Add test case
@test
public void testScoringMatchingBug() throws Throwable {
MapperFactory factory = new DefaultMapperFactory.Builder().classMapBuilderFactory(new ScoringClassMapBuilder.Factory()).build();
}
result
Unit test failed. Title is incorrectly mapped to lengthTitle and should be mapped to title first, content is the same
expect result
Unit test passed.
The text was updated successfully, but these errors were encountered: