Skip to content

Commit c3a45d0

Browse files
Ahmed Tawilapivovarit
authored andcommitted
BAEL-1171 String.lang.String API (eugenp#2742)
* Evaluation article: Different Types of Bean Injection in Spring * added tests & changed configuration to Java-based config * removed xml config files * rename unit tests * BAEL-972 - Apache Commons Text * remove code from evaluation article * remove code from evaluation article * BAEL-972 - Apache Commons Text - added another example * BAEL-972 - Apache Commons Text - just indentation * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java - fix problems * BAEL-1033 Introduction to StreamUtils * BAEL-1033 Introduction to StreamUtils * BAEL-1033 Introduction to StreamUtils * fix formatting * BAEL-1033 minor refactor * BAEL-1035 Introduction to Eclipse Collections * format * BAEL-1035 Introduction to Eclipse Collections * BAEL-1035 Introduction to Eclipse Collections * BAEL-1035 Introduction to Eclipse Collections * cleanup * cleanup * BAEL-1109 Introduction to JCache * BAEL-1109 Introduction to JCache * remove unneeded property in pom.xml * fix formatting * close cache instances properly * remove latest commit * BAEL-1057 Introduction to rxjava-jdbc * refactor rxjava-jdbc * Refactor rxjava-jdbc * Refactoring rxjava-jdbc * BAEL-1171 java.lang.String API * refactor rxjava-jdbc * refactor String * String API - move multiple classes into a single class * move class into test package * BAEL-1171 String.lang.String API * BAEL-1171 java.lang.String API
1 parent b85bb1a commit c3a45d0

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎core-java/src/test/java/com/baeldung/string/StringTest.java‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
import static org.junit.Assert.assertArrayEquals;
44
import static org.junit.Assert.assertEquals;
5-
import static org.junit.Assert.assertTrue;
65
import static org.junit.Assert.assertFalse;
6+
import static org.junit.Assert.assertTrue;
77

8-
import java.nio.charset.Charset;
98
import java.nio.charset.StandardCharsets;
109
import java.util.IllegalFormatException;
1110
import java.util.regex.PatternSyntaxException;
@@ -38,7 +37,7 @@ public void whenGetBytes_thenCorrect() {
3837
}
3938

4039
@Test
41-
public void whenGetBytesUsingUTF16_thenCorrect() {
40+
public void whenGetBytesUsingASCII_thenCorrect() {
4241
byte[] byteArray = "efgh".getBytes(StandardCharsets.US_ASCII);
4342
byte[] expected = new byte[] { 101, 102, 103, 104 };
4443

@@ -156,6 +155,13 @@ public void whenPassInvalidParameterToSplit_thenPatternSyntaxExceptionThrown() {
156155
String[] result = s.split("*");
157156
}
158157

158+
@Test
159+
public void whenCallSubSequence_thenCorrect() {
160+
String s = "Welcome to Baeldung";
161+
162+
assertEquals("Welcome", s.subSequence(0, 7));
163+
}
164+
159165
@Test
160166
public void whenCallSubstring_thenCorrect() {
161167
String s = "Welcome to Baeldung";

0 commit comments

Comments
 (0)