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:
Teica
2021-11-30 01:26:16 +01:00
committed by GitHub
parent ec85ef689f
commit 3041ad3724
3 changed files with 10 additions and 5 deletions

View File

@@ -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)));
}
}