From 337abc8c6d23b6252ba86b8c049304aa1c5163fd Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Tue, 17 Apr 2018 23:42:21 -0400 Subject: [PATCH] Revert fields from public to protected in tests --- .../java/com/moparisthebest/jdbc/dto/FieldBoss.java | 4 ++-- .../java/com/moparisthebest/jdbc/dto/FieldPerson.java | 10 ++++++++-- .../com/moparisthebest/jdbc/dto/ReverseFieldBoss.java | 4 ++-- .../moparisthebest/jdbc/dto/ReverseFieldPerson.java | 8 ++++---- .../com/moparisthebest/jdbc/dto/ReverseSetBoss.java | 4 ++-- .../moparisthebest/jdbc/CleaningQueryMapperTest.java | 4 +--- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/test/src/main/java/com/moparisthebest/jdbc/dto/FieldBoss.java b/test/src/main/java/com/moparisthebest/jdbc/dto/FieldBoss.java index 3fd8ad7..7e66454 100644 --- a/test/src/main/java/com/moparisthebest/jdbc/dto/FieldBoss.java +++ b/test/src/main/java/com/moparisthebest/jdbc/dto/FieldBoss.java @@ -6,8 +6,8 @@ import java.util.Date; * Created by mopar on 6/10/14. */ public class FieldBoss extends FieldPerson implements Boss { - public String department; - public String first_name; + protected String department; + protected String first_name; public FieldBoss() { super(); diff --git a/test/src/main/java/com/moparisthebest/jdbc/dto/FieldPerson.java b/test/src/main/java/com/moparisthebest/jdbc/dto/FieldPerson.java index 9b12b1a..c84ed42 100644 --- a/test/src/main/java/com/moparisthebest/jdbc/dto/FieldPerson.java +++ b/test/src/main/java/com/moparisthebest/jdbc/dto/FieldPerson.java @@ -9,8 +9,8 @@ public class FieldPerson implements Person { protected long personNo; protected Date birthDate; - public String firstName; - public String lastName; + protected String firstName; + protected String lastName; public FieldPerson(){ } @@ -64,4 +64,10 @@ public class FieldPerson implements Person { ", lastName='" + lastName + '\'' + '}'; } + + public FieldPerson cleanThyself() { + this.firstName += " " + this.lastName; + this.lastName = null; + return this; + } } diff --git a/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseFieldBoss.java b/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseFieldBoss.java index 1d84e70..0d10029 100644 --- a/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseFieldBoss.java +++ b/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseFieldBoss.java @@ -6,8 +6,8 @@ import java.util.Date; * Created by mopar on 6/10/14. */ public class ReverseFieldBoss extends ReverseFieldPerson implements Boss { - public String department; - public String firstName; + protected String department; + protected String firstName; public ReverseFieldBoss() { super(); diff --git a/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseFieldPerson.java b/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseFieldPerson.java index 9158c4e..4ebe065 100644 --- a/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseFieldPerson.java +++ b/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseFieldPerson.java @@ -7,10 +7,10 @@ import java.util.Date; */ public class ReverseFieldPerson implements Person { - public long personNo; - public Date birthDate; - public String first_name; - public String lastName; + protected long personNo; + protected Date birthDate; + protected String first_name; + protected String lastName; public ReverseFieldPerson(){ } diff --git a/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseSetBoss.java b/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseSetBoss.java index 7bae486..f0c2006 100644 --- a/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseSetBoss.java +++ b/test/src/main/java/com/moparisthebest/jdbc/dto/ReverseSetBoss.java @@ -6,8 +6,8 @@ import java.util.Date; * Created by mopar on 6/10/14. */ public class ReverseSetBoss extends ReverseSetPerson implements Boss { - public String department; - public String firstName; + protected String department; + protected String firstName; public ReverseSetBoss() { super(); diff --git a/test/src/test/java/com/moparisthebest/jdbc/CleaningQueryMapperTest.java b/test/src/test/java/com/moparisthebest/jdbc/CleaningQueryMapperTest.java index 80e451a..ce334cf 100644 --- a/test/src/test/java/com/moparisthebest/jdbc/CleaningQueryMapperTest.java +++ b/test/src/test/java/com/moparisthebest/jdbc/CleaningQueryMapperTest.java @@ -57,9 +57,7 @@ public class CleaningQueryMapperTest { final Cleaner personCleaner = new Cleaner() { @Override public FieldPerson clean(final FieldPerson dto) { - dto.firstName += " " + dto.lastName; - dto.lastName = null; - return dto; + return dto.cleanThyself(); } }; return Arrays.asList(new Object[][] {