ClockGus.formatted(date) renaming method
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Mon, 5 Dec 2016 08:48:13 +0000 (09:48 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Mon, 5 Dec 2016 08:48:13 +0000 (09:48 +0100)
TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/ClockGus.java
TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/ClockGusShould.java

index cdad1ba..cae3a68 100644 (file)
@@ -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 formatted(LocalDate.now());
        }
 
-       protected String formattedToday(LocalDate date) {
+       protected String formatted(LocalDate date) {
                return date.format(DD_MM_YYYY);
        }
 }
index 866466e..1dac5d8 100644 (file)
@@ -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.formatted(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)).formatted(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.formatted(today);
                
                assertThat(date, is(today.format(DD_MM_YYYY)));
        }