Feature bael 5253 (#11526)
* BAEL-5032 Swagger to PDF * BAEL-5032 added lombok as dependency * BAEL-5253 moving the tests to other module * renaming the test class * Update pom.xml * Update pom.xml * Update pom.xml * Delete pom.xml * Create pom.xml Co-authored-by: Matea Pejčinović <matea.pejcinovic@intellexi.hr>
This commit is contained in:
@@ -24,6 +24,11 @@
|
||||
<artifactId>commons-validator</artifactId>
|
||||
<version>${validator.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>${guava.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -49,8 +54,8 @@
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<guava.version>28.1-jre</guava.version>
|
||||
<guava.version>31.0.1-jre</guava.version>
|
||||
<validator.version>1.7</validator.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.baeldung.isuppercase;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import com.google.common.base.Ascii;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.matchesPattern;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class StringFirstCharacterUppercaseUnitTest {
|
||||
|
||||
@Test
|
||||
public void givenString_whenCheckingWithCharacterIsUpperCase_thenStringCapitalized() {
|
||||
String example = "Katie";
|
||||
Assertions.assertTrue(Character.isUpperCase(example.charAt(0)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenString_whenCheckingWithRegex_thenStringCapitalized() {
|
||||
String example = "Katie";
|
||||
String regEx = "[A-Z]\\w*";
|
||||
assertThat(example, matchesPattern(regEx));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenString_whenCheckingWithGuava_thenStringCapitalized() {
|
||||
String example = "Katie";
|
||||
Assertions.assertTrue(Ascii.isUpperCase(example.charAt(0)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user