BAEL-1171 java.lang.String API
This commit is contained in:
parent
5253362653
commit
9f9fa935a8
@ -0,0 +1,12 @@
|
||||
package com.baeldung.string;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import org.junit.Test;
|
||||
|
||||
public class CodePointAtTest {
|
||||
|
||||
@Test
|
||||
public void whenCallCodePointAt_thenDecimalUnicodeReturned() {
|
||||
assertEquals(97, "abcd".codePointAt(0));
|
||||
}
|
||||
}
|
12
core-java/src/main/java/com/baeldung/string/ConcatTest.java
Normal file
12
core-java/src/main/java/com/baeldung/string/ConcatTest.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.baeldung.string;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ConcatTest {
|
||||
|
||||
@Test
|
||||
public void whenCallConcat_thenCorrect() {
|
||||
assertEquals("elephant", "elep".concat("hant"));
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.baeldung.string;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import org.junit.Test;
|
||||
|
||||
public class GetBytesTest {
|
||||
|
||||
@Test
|
||||
public void whenGetBytes_thenCorrect() {
|
||||
byte[] byteArray = "abcd".getBytes();
|
||||
byte[] expected = new byte[] { 97, 98, 99, 100 };
|
||||
assertArrayEquals(expected, byteArray);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user