mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#782 Use more desriptive names in tests
This commit is contained in:
parent
768a739a09
commit
3b9d5413f4
@ -20,25 +20,25 @@ package org.mapstruct.ap.test.builder.parentchild;
|
||||
|
||||
public class ImmutableChild {
|
||||
|
||||
private final String bar;
|
||||
private final String name;
|
||||
|
||||
private ImmutableChild(Builder builder) {
|
||||
this.bar = builder.bar;
|
||||
this.name = builder.name;
|
||||
}
|
||||
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public String getBar() {
|
||||
return bar;
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private String bar;
|
||||
private String name;
|
||||
|
||||
public ImmutableChild.Builder bar(String bar) {
|
||||
this.bar = bar;
|
||||
public ImmutableChild.Builder name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -19,20 +19,21 @@
|
||||
package org.mapstruct.ap.test.builder.parentchild;
|
||||
|
||||
public class MutableChild {
|
||||
|
||||
public MutableChild() {
|
||||
}
|
||||
|
||||
public MutableChild(String foo) {
|
||||
this.foo = foo;
|
||||
public MutableChild(String childName) {
|
||||
this.childName = childName;
|
||||
}
|
||||
|
||||
private String foo;
|
||||
private String childName;
|
||||
|
||||
public String getFoo() {
|
||||
return foo;
|
||||
public String getChildName() {
|
||||
return childName;
|
||||
}
|
||||
|
||||
public void setFoo(String foo) {
|
||||
this.foo = foo;
|
||||
public void setChildName(String childName) {
|
||||
this.childName = childName;
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class ParentChildBuilderTest {
|
||||
return new Condition<ImmutableChild>( "Matching name" ) {
|
||||
@Override
|
||||
public boolean matches(ImmutableChild value) {
|
||||
return name.equals( value.getBar() );
|
||||
return name.equals( value.getName() );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -29,6 +29,6 @@ public interface ParentChildMapper {
|
||||
|
||||
ImmutableParent toParent(MutableParent source);
|
||||
|
||||
@Mapping(target = "bar", source = "foo")
|
||||
@Mapping(target = "name", source = "childName")
|
||||
ImmutableChild toChild(MutableChild source);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user