diff --git a/simple-algorithms/counting-uppercase/build.gradle b/simple-algorithms/counting-uppercase/build.gradle index 5584480..9f5b988 100644 --- a/simple-algorithms/counting-uppercase/build.gradle +++ b/simple-algorithms/counting-uppercase/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' } -def junitJupiterVersion = '5.7.0' +def junitJupiterVersion = '5.10.2' group 'com.josdem.kata' version '1.0-SNAPSHOT' diff --git a/simple-algorithms/counting-uppercase/gradle/wrapper/gradle-wrapper.properties b/simple-algorithms/counting-uppercase/gradle/wrapper/gradle-wrapper.properties index aa991fc..a595206 100644 --- a/simple-algorithms/counting-uppercase/gradle/wrapper/gradle-wrapper.properties +++ b/simple-algorithms/counting-uppercase/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-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-uppercase/src/main/java/com/josdem/kata/UppercaseCounter.java b/simple-algorithms/counting-uppercase/src/main/java/com/josdem/kata/UppercaseCounter.java index b9e1cd8..d07c29c 100644 --- a/simple-algorithms/counting-uppercase/src/main/java/com/josdem/kata/UppercaseCounter.java +++ b/simple-algorithms/counting-uppercase/src/main/java/com/josdem/kata/UppercaseCounter.java @@ -2,11 +2,11 @@ public class UppercaseCounter { - public int count(String message) { - return (int) message.chars().filter(it -> it >= 65 && it <= 90).count(); - } + public int count(String message) { + return message.length(); + } - public boolean hasSpace(String message) { - return message.contains(" "); - } + public boolean hasSpace(String message) { + return message.isEmpty(); + } } diff --git a/simple-algorithms/counting-uppercase/src/test/java/com/josdem/kata/CountingUppercaseTest.java b/simple-algorithms/counting-uppercase/src/test/java/com/josdem/kata/CountingUppercaseTest.java index ca72aad..f80a265 100644 --- a/simple-algorithms/counting-uppercase/src/test/java/com/josdem/kata/CountingUppercaseTest.java +++ b/simple-algorithms/counting-uppercase/src/test/java/com/josdem/kata/CountingUppercaseTest.java @@ -14,7 +14,7 @@ class CountingUppercaseTest { - private UppercaseCounter uppercaseCounter = new UppercaseCounter(); + private final UppercaseCounter uppercaseCounter = new UppercaseCounter(); @Test @DisplayName("count three uppercase")