BAEL-5354 Add improvement to cover JDK11 solution to the repeated string problem (#11756)
This commit is contained in:
parent
6f6b8e23e0
commit
69e04d5ac0
|
@ -49,8 +49,9 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<validator.version>1.7</validator.version>
|
||||
<apache-commons-lang3.version>3.12.0</apache-commons-lang3.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -19,6 +19,18 @@ class RepeatedCharacterStringUnitTest {
|
|||
private static final String EXPECTED_STRING = "aaaaaaa";
|
||||
private static final int N = 7;
|
||||
|
||||
@Test
|
||||
void givenSingleCharacterString_whenRepeat_thenStringCreated() {
|
||||
String newString = "a".repeat(N);
|
||||
assertEquals(EXPECTED_STRING, newString);
|
||||
}
|
||||
|
||||
@Test
|
||||
void givenMultiCharacterString_whenRepeat_thenStringCreated() {
|
||||
String newString = "-->".repeat(5);
|
||||
assertEquals("-->-->-->-->-->", newString);
|
||||
}
|
||||
|
||||
@Test
|
||||
void givenString_whenStringBuilderUsed_thenStringCreated() {
|
||||
StringBuilder builder = new StringBuilder(N);
|
||||
|
|
|
@ -107,7 +107,6 @@
|
|||
<module>core-java-streams-4</module>
|
||||
<module>core-java-string-algorithms</module>
|
||||
<module>core-java-string-algorithms-2</module>
|
||||
<module>core-java-string-algorithms-3</module>
|
||||
<module>core-java-string-apis</module>
|
||||
<module>core-java-string-conversions</module>
|
||||
<module>core-java-string-conversions-2</module>
|
||||
|
|
1
pom.xml
1
pom.xml
|
@ -1333,6 +1333,7 @@
|
|||
<module>core-java-modules/core-java-io-conversions-2</module>
|
||||
<module>core-java-modules/core-java-jpms</module>
|
||||
<module>core-java-modules/core-java-os</module>
|
||||
<module>core-java-modules/core-java-string-algorithms-3</module>
|
||||
<module>core-java-modules/core-java-string-operations-3</module>
|
||||
<module>core-java-modules/core-java-string-operations-4</module>
|
||||
<module>core-java-modules/core-java-time-measurements</module>
|
||||
|
|
Loading…
Reference in New Issue