这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions core-java-modules/core-java-string-operations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,11 @@
<release>21</release>
<!-- Needed due to a bug with JDK 21, described here: https://issues.apache.org/jira/browse/MCOMPILER-546?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&focusedCommentId=17767513 -->
<debug>false</debug>
<compilerArgs>
<arg>--enable-preview</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkCount>0</forkCount>
<argLine>--enable-preview</argLine>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.baeldung.stringinterpolation;

import static java.lang.StringTemplate.STR;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.text.MessageFormat;
Expand All @@ -11,6 +10,7 @@
import org.junit.jupiter.api.Test;

public class StringInterpolationUnitTest {

private final String EXPECTED_STRING = "String Interpolation in Java with some Java examples.";

@Test
Expand Down Expand Up @@ -70,14 +70,6 @@ public void givenTwoString_thenInterpolateWithMessageFormat() {
assertEquals(EXPECTED_STRING, result);
}

@Test
public void whenInterpolateWithStringTemplate_thenGetExpectedResult() {
String first = "Interpolation";
String second = "Java";
String result = STR."String \{first} in \{second} with some \{second} examples.";
assertEquals(EXPECTED_STRING, result);
}

@Test
public void givenTwoString_thenInterpolateWithStringSubstitutor() {
String baseString = "String ${first} in ${second} with some ${second} examples.";
Expand Down