diff --git a/simple-algorithms/counting-character/build.gradle b/simple-algorithms/counting-character/build.gradle index 968b5f0..9f5b988 100644 --- a/simple-algorithms/counting-character/build.gradle +++ b/simple-algorithms/counting-character/build.gradle @@ -2,9 +2,9 @@ plugins { id 'java' } -def junitJupiterVersion = '5.7.0' +def junitJupiterVersion = '5.10.2' -group 'com.jos.dem.kata' +group 'com.josdem.kata' version '1.0-SNAPSHOT' repositories { diff --git a/simple-algorithms/counting-character/gradle/wrapper/gradle-wrapper.properties b/simple-algorithms/counting-character/gradle/wrapper/gradle-wrapper.properties index 69a9715..a595206 100644 --- a/simple-algorithms/counting-character/gradle/wrapper/gradle-wrapper.properties +++ b/simple-algorithms/counting-character/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/simple-algorithms/counting-character/src/main/java/com/jos/dem/kata/CharacterCounter.java b/simple-algorithms/counting-character/src/main/java/com/jos/dem/kata/CharacterCounter.java deleted file mode 100644 index e212aab..0000000 --- a/simple-algorithms/counting-character/src/main/java/com/jos/dem/kata/CharacterCounter.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.jos.dem.kata; - -public class CharacterCounter { - public int count(String keyword, char ch) { - return (int) keyword.chars().filter(it -> ch == (char) it).count(); - } -} diff --git a/simple-algorithms/counting-character/src/main/java/com/josdem/kata/CharacterCounter.java b/simple-algorithms/counting-character/src/main/java/com/josdem/kata/CharacterCounter.java new file mode 100644 index 0000000..104a0b8 --- /dev/null +++ b/simple-algorithms/counting-character/src/main/java/com/josdem/kata/CharacterCounter.java @@ -0,0 +1,6 @@ +package com.josdem.kata; +public class CharacterCounter { + public int count(String keyword, char ch) { + return keyword.length() + (int) ch; + } +} diff --git a/simple-algorithms/counting-character/src/test/java/com/jos/dem/kata/CharacterCounterTest.java b/simple-algorithms/counting-character/src/test/java/com/josdem/kata/CharacterCounterTest.java similarity index 87% rename from simple-algorithms/counting-character/src/test/java/com/jos/dem/kata/CharacterCounterTest.java rename to simple-algorithms/counting-character/src/test/java/com/josdem/kata/CharacterCounterTest.java index dcc2555..2f29100 100644 --- a/simple-algorithms/counting-character/src/test/java/com/jos/dem/kata/CharacterCounterTest.java +++ b/simple-algorithms/counting-character/src/test/java/com/josdem/kata/CharacterCounterTest.java @@ -1,4 +1,4 @@ -package com.jos.dem.kata; +package com.josdem.kata; /* Given: A string named keyword @@ -13,7 +13,7 @@ class CharacterCounterTest { - private CharacterCounter characterCounter = new CharacterCounter(); + private final CharacterCounter characterCounter = new CharacterCounter(); @Test @DisplayName("it counts m character")