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 {
|
public class ImmutableChild {
|
||||||
|
|
||||||
private final String bar;
|
private final String name;
|
||||||
|
|
||||||
private ImmutableChild(Builder builder) {
|
private ImmutableChild(Builder builder) {
|
||||||
this.bar = builder.bar;
|
this.name = builder.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBar() {
|
public String getName() {
|
||||||
return bar;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private String bar;
|
private String name;
|
||||||
|
|
||||||
public ImmutableChild.Builder bar(String bar) {
|
public ImmutableChild.Builder name(String name) {
|
||||||
this.bar = bar;
|
this.name = name;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,20 +19,21 @@
|
|||||||
package org.mapstruct.ap.test.builder.parentchild;
|
package org.mapstruct.ap.test.builder.parentchild;
|
||||||
|
|
||||||
public class MutableChild {
|
public class MutableChild {
|
||||||
|
|
||||||
public MutableChild() {
|
public MutableChild() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public MutableChild(String foo) {
|
public MutableChild(String childName) {
|
||||||
this.foo = foo;
|
this.childName = childName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String foo;
|
private String childName;
|
||||||
|
|
||||||
public String getFoo() {
|
public String getChildName() {
|
||||||
return foo;
|
return childName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFoo(String foo) {
|
public void setChildName(String childName) {
|
||||||
this.foo = foo;
|
this.childName = childName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ public class ParentChildBuilderTest {
|
|||||||
return new Condition<ImmutableChild>( "Matching name" ) {
|
return new Condition<ImmutableChild>( "Matching name" ) {
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(ImmutableChild value) {
|
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);
|
ImmutableParent toParent(MutableParent source);
|
||||||
|
|
||||||
@Mapping(target = "bar", source = "foo")
|
@Mapping(target = "name", source = "childName")
|
||||||
ImmutableChild toChild(MutableChild source);
|
ImmutableChild toChild(MutableChild source);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user