From 02ec278b71940ce1d7cf1b1e4618c9496ee69b30 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Mon, 5 Dec 2016 09:48:13 +0100 Subject: [PATCH] ClockGus.format(date) renaming method --- .../bank/src/main/java/org/craftedsw/feature/ClockGus.java | 4 ++-- .../bank/src/test/java/org/craftedsw/feature/ClockGusShould.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/ClockGus.java b/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/ClockGus.java index cdad1ba..585c946 100644 --- a/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/ClockGus.java +++ b/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/ClockGus.java @@ -8,10 +8,10 @@ public class ClockGus { private static final DateTimeFormatter DD_MM_YYYY = DateTimeFormatter.ofPattern("dd/MM/yyyy"); public String todayAsString() { - return formattedToday(LocalDate.now()); + return format(LocalDate.now()); } - protected String formattedToday(LocalDate date) { + protected String format(LocalDate date) { return date.format(DD_MM_YYYY); } } diff --git a/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/ClockGusShould.java b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/ClockGusShould.java index 866466e..dce1aa1 100644 --- a/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/ClockGusShould.java +++ b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/ClockGusShould.java @@ -19,12 +19,12 @@ public class ClockGusShould { return_todays_date_in_dd_MM_yyyy_format() { ClockGus clock = spy(new ClockGus()); LocalDate today = today(); - given(clock.formattedToday(today)).willReturn(today.format(DD_MM_YYYY)); + given(clock.format(today)).willReturn(today.format(DD_MM_YYYY)); String date = clock.todayAsString(); assertThat(date, is(today.format(DD_MM_YYYY))); - verify(clock, times(1)).formattedToday(today); + verify(clock, times(1)).format(today); } @Test public void @@ -32,7 +32,7 @@ public class ClockGusShould { ClockGus clock = new ClockGus(); LocalDate today = today(); - String date = clock.formattedToday(today); + String date = clock.format(today); assertThat(date, is(today.format(DD_MM_YYYY))); } -- 2.1.4