Refactor method name

This commit is contained in:
Marcin Krykowski
2020-06-15 22:48:06 +01:00
parent 11e6f61f9d
commit 998dd8f7b6
2 changed files with 2 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ public class FormatNumber {
return String.format("%." + places + "f", value);
}
public static String byPaddingOutZeros(int value, int paddingLength) {
public static String byPaddingZeros(int value, int paddingLength) {
return String.format("%0" + paddingLength + "d", value);
}

View File

@@ -49,7 +49,7 @@ public class FormatNumberUnitTest {
@Test
public void givenIntegerNumber_whenFormatNumber_byPaddingOutZeros_thenGetExpectedResult() {
int value = 1;
assertThat(byPaddingOutZeros(value, 3)).isEqualTo("001");
assertThat(byPaddingZeros(value, 3)).isEqualTo("001");
}
@Test