Skip to content

Commit c74d84c

Browse files
committed
Fix build, reformat code
1 parent c9ee543 commit c74d84c

File tree

3 files changed

+37
-40
lines changed

3 files changed

+37
-40
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<dependencies>
4040
<dependency>
4141
<groupId>org.junit.jupiter</groupId>
42-
<artifactId>junit-jupiter</artifactId>
42+
<artifactId>junit-jupiter-api</artifactId>
4343
<scope>test</scope>
4444
</dependency>
4545
</dependencies>

src/main/java/org/codehaus/plexus/interpolation/FeedbackingValueSource.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,24 @@
2121
* <p>One of the obvious usages is to add FeedbackingValueSource as last value source to {@link Interpolator}
2222
* to add feedback messages indicating not resolved expressions.</p>
2323
*/
24-
public class FeedbackingValueSource extends AbstractValueSource
25-
{
24+
public class FeedbackingValueSource extends AbstractValueSource {
2625
private final String messagePattern;
2726

28-
public FeedbackingValueSource()
29-
{
30-
this( "'${expression}' not resolved" );
27+
public FeedbackingValueSource() {
28+
this("'${expression}' not resolved");
3129
}
3230

3331
/**
3432
* @param messagePattern could contain <code>${expression}</code> placeholder
3533
*/
36-
public FeedbackingValueSource( String messagePattern )
37-
{
38-
super( true );
34+
public FeedbackingValueSource(String messagePattern) {
35+
super(true);
3936
this.messagePattern = messagePattern;
4037
}
4138

4239
@Override
43-
public Object getValue( String expression )
44-
{
45-
addFeedback( messagePattern.replace( "${expression}", expression ) );
40+
public Object getValue(String expression) {
41+
addFeedback(messagePattern.replace("${expression}", expression));
4642
return null;
4743
}
4844
}

src/test/java/org/codehaus/plexus/interpolation/FeedbackingValueSourceTest.java

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,47 +16,48 @@
1616
* limitations under the License.
1717
*/
1818

19-
import junit.framework.TestCase;
19+
import org.junit.jupiter.api.Test;
2020

2121
import static java.util.Collections.singletonMap;
22+
import static org.junit.jupiter.api.Assertions.assertEquals;
23+
import static org.junit.jupiter.api.Assertions.assertNull;
24+
import static org.junit.jupiter.api.Assertions.assertTrue;
2225

23-
public class FeedbackingValueSourceTest
24-
extends TestCase
25-
{
26+
public class FeedbackingValueSourceTest {
2627

27-
public void testStandalone()
28-
{
28+
@Test
29+
public void testStandalone() {
2930
ValueSource valueSource = new FeedbackingValueSource();
30-
assertNull( valueSource.getValue( "test" ) );
31-
assertEquals( 1, valueSource.getFeedback().size() );
32-
assertEquals( "'test' not resolved", valueSource.getFeedback().iterator().next() );
31+
assertNull(valueSource.getValue("test"));
32+
assertEquals(1, valueSource.getFeedback().size());
33+
assertEquals("'test' not resolved", valueSource.getFeedback().iterator().next());
3334
}
3435

35-
public void testAfterResolvedExpression() throws InterpolationException
36-
{
36+
@Test
37+
public void testAfterResolvedExpression() throws InterpolationException {
3738
StringSearchInterpolator interpolator = new StringSearchInterpolator();
38-
interpolator.addValueSource( new MapBasedValueSource( singletonMap( "key", "val" ) ) );
39-
interpolator.addValueSource( new FeedbackingValueSource() );
40-
assertEquals( "val", interpolator.interpolate( "${key}" ) );
41-
assertTrue( interpolator.getFeedback().isEmpty() );
39+
interpolator.addValueSource(new MapBasedValueSource(singletonMap("key", "val")));
40+
interpolator.addValueSource(new FeedbackingValueSource());
41+
assertEquals("val", interpolator.interpolate("${key}"));
42+
assertTrue(interpolator.getFeedback().isEmpty());
4243
}
4344

44-
public void testBeforeResolvedExpression() throws InterpolationException
45-
{
45+
@Test
46+
public void testBeforeResolvedExpression() throws InterpolationException {
4647
StringSearchInterpolator interpolator = new StringSearchInterpolator();
47-
interpolator.addValueSource( new FeedbackingValueSource("Resolving ${expression}") );
48-
interpolator.addValueSource( new MapBasedValueSource( singletonMap( "key", "val" ) ) );
49-
assertEquals( "val", interpolator.interpolate( "${key}" ) );
50-
assertEquals( 1, interpolator.getFeedback().size() );
51-
assertEquals( "Resolving key", interpolator.getFeedback().iterator().next() );
48+
interpolator.addValueSource(new FeedbackingValueSource("Resolving ${expression}"));
49+
interpolator.addValueSource(new MapBasedValueSource(singletonMap("key", "val")));
50+
assertEquals("val", interpolator.interpolate("${key}"));
51+
assertEquals(1, interpolator.getFeedback().size());
52+
assertEquals("Resolving key", interpolator.getFeedback().iterator().next());
5253
}
5354

54-
public void testAfterNotResolvedExpression() throws InterpolationException
55-
{
55+
@Test
56+
public void testAfterNotResolvedExpression() throws InterpolationException {
5657
StringSearchInterpolator interpolator = new StringSearchInterpolator();
57-
interpolator.addValueSource( new MapBasedValueSource( singletonMap( "key", "val" ) ) );
58-
interpolator.addValueSource( new FeedbackingValueSource() );
59-
assertEquals( "${other-key}", interpolator.interpolate( "${other-key}" ) );
60-
assertEquals( 1, interpolator.getFeedback().size() );
58+
interpolator.addValueSource(new MapBasedValueSource(singletonMap("key", "val")));
59+
interpolator.addValueSource(new FeedbackingValueSource());
60+
assertEquals("${other-key}", interpolator.interpolate("${other-key}"));
61+
assertEquals(1, interpolator.getFeedback().size());
6162
}
6263
}

0 commit comments

Comments
 (0)