From 3b9d5413f481442c7fcc9107d628cdfff41a3859 Mon Sep 17 00:00:00 2001 From: sjaakd Date: Sun, 18 Mar 2018 17:06:13 +0100 Subject: [PATCH] #782 Use more desriptive names in tests --- .../test/builder/parentchild/ImmutableChild.java | 14 +++++++------- .../ap/test/builder/parentchild/MutableChild.java | 15 ++++++++------- .../parentchild/ParentChildBuilderTest.java | 2 +- .../builder/parentchild/ParentChildMapper.java | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ImmutableChild.java b/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ImmutableChild.java index 8c7e45a82..3f95ce98c 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ImmutableChild.java +++ b/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ImmutableChild.java @@ -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; } diff --git a/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/MutableChild.java b/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/MutableChild.java index 692a6414d..a3688275d 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/MutableChild.java +++ b/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/MutableChild.java @@ -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; } } diff --git a/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ParentChildBuilderTest.java b/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ParentChildBuilderTest.java index 4d7d9b2cc..671c095cc 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ParentChildBuilderTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ParentChildBuilderTest.java @@ -61,7 +61,7 @@ public class ParentChildBuilderTest { return new Condition( "Matching name" ) { @Override public boolean matches(ImmutableChild value) { - return name.equals( value.getBar() ); + return name.equals( value.getName() ); } }; } diff --git a/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ParentChildMapper.java b/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ParentChildMapper.java index 2a66469a6..479d4f5e9 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ParentChildMapper.java +++ b/processor/src/test/java/org/mapstruct/ap/test/builder/parentchild/ParentChildMapper.java @@ -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); }