Skip to content

Commit 88a6176

Browse files
Use plexus-testing instead of direct sisu InjectedTest
In plexus-testing we manage more configurations for plexus container and guice
1 parent 3514c48 commit 88a6176

File tree

2 files changed

+16
-24
lines changed

2 files changed

+16
-24
lines changed

pom.xml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,14 @@ limitations under the License.
7575
</dependency>
7676

7777
<dependency>
78-
<groupId>org.eclipse.sisu</groupId>
79-
<artifactId>org.eclipse.sisu.inject</artifactId>
80-
<version>0.9.0.M4</version>
78+
<groupId>org.junit.jupiter</groupId>
79+
<artifactId>junit-jupiter-api</artifactId>
8180
<scope>test</scope>
8281
</dependency>
83-
8482
<dependency>
85-
<groupId>org.junit.jupiter</groupId>
86-
<artifactId>junit-jupiter-api</artifactId>
83+
<groupId>org.codehaus.plexus</groupId>
84+
<artifactId>plexus-testing</artifactId>
85+
<version>1.6.1</version>
8786
<scope>test</scope>
8887
</dependency>
8988
<dependency>
@@ -92,12 +91,6 @@ limitations under the License.
9291
<version>${slf4jVersion}</version>
9392
<scope>test</scope>
9493
</dependency>
95-
<dependency>
96-
<groupId>com.google.inject</groupId>
97-
<artifactId>guice</artifactId>
98-
<version>6.0.0</version>
99-
<scope>test</scope>
100-
</dependency>
10194
</dependencies>
10295

10396
<build>

src/test/java/org/codehaus/plexus/velocity/DefaultVelocityComponentTest.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,35 @@
1616
* limitations under the License.
1717
*/
1818

19+
import javax.inject.Inject;
20+
1921
import java.io.StringWriter;
2022

2123
import org.apache.velocity.Template;
2224
import org.apache.velocity.VelocityContext;
23-
import org.eclipse.sisu.launch.InjectedTest;
25+
import org.codehaus.plexus.testing.PlexusTest;
2426
import org.junit.jupiter.api.Test;
2527

2628
import static org.junit.jupiter.api.Assertions.assertEquals;
2729
import static org.junit.jupiter.api.Assertions.assertNotNull;
2830

29-
public class DefaultVelocityComponentTest extends InjectedTest {
30-
@Test
31-
public void testBasic() {
32-
VelocityComponent velocity;
33-
34-
VelocityContext context;
31+
@PlexusTest
32+
public class DefaultVelocityComponentTest {
3533

36-
String value;
34+
@Inject
35+
private VelocityComponent velocity;
3736

38-
velocity = lookup(VelocityComponent.class);
37+
@Test
38+
public void testBasic() {
3939

4040
// test the properties
41-
value = (String) velocity.getEngine().getProperty("hello");
41+
String value = (String) velocity.getEngine().getProperty("hello");
4242

4343
assertNotNull(value);
44-
4544
assertEquals("world", value);
4645

4746
// test the rendering
48-
context = new VelocityContext();
47+
VelocityContext context = new VelocityContext();
4948

5049
context.put("variable", "Value from context");
5150

0 commit comments

Comments
 (0)