File tree 4 files changed +68
-0
lines changed
src/test/java/org/codehaus/plexus/testing
4 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 62
62
<artifactId >guice</artifactId >
63
63
<version >6.0.0</version >
64
64
</dependency >
65
+ <dependency >
66
+ <groupId >jakarta.annotation</groupId >
67
+ <artifactId >jakarta.annotation-api</artifactId >
68
+ <version >2.1.1</version >
69
+ <scope >provided</scope >
70
+ <optional >true</optional >
71
+ </dependency >
72
+
65
73
<dependency >
66
74
<groupId >org.junit.jupiter</groupId >
67
75
<artifactId >junit-jupiter-api</artifactId >
Original file line number Diff line number Diff line change 23
23
import org .junit .jupiter .api .Test ;
24
24
25
25
import static org .junit .jupiter .api .Assertions .assertNotNull ;
26
+ import static org .junit .jupiter .api .Assertions .assertNull ;
26
27
27
28
@ PlexusTest
28
29
class PlexusTestJakartaTest {
@@ -34,6 +35,12 @@ class PlexusTestJakartaTest {
34
35
void dependencyShouldBeInjected () {
35
36
assertNotNull (testJakartaComponent );
36
37
assertNotNull (testJakartaComponent .getTestJakartaComponent2 ());
38
+ assertNotNull (testJakartaComponent .getTestJakartaComponent3Named ());
39
+ assertNull (testJakartaComponent .getTestJakartaComponent3NullableJavax ());
40
+ assertNull (testJakartaComponent .getTestJakartaComponent3NullableJakarta ());
41
+
42
+ assertNotNull (testJakartaComponent .getTestJavaxComponent2 ());
43
+ assertNotNull (testJakartaComponent .getTestJavaxComponent2 ());
37
44
assertNotNull (testJakartaComponent .getTestJavaxComponent2 ());
38
45
}
39
46
}
Original file line number Diff line number Diff line change 19
19
* under the License.
20
20
*/
21
21
22
+ import jakarta .annotation .Nonnull ;
22
23
import jakarta .inject .Inject ;
23
24
import jakarta .inject .Named ;
24
25
@@ -30,11 +31,38 @@ public class TestJakartaComponent {
30
31
@ Inject
31
32
private TestJakartaComponent2 testJakartaComponent2 ;
32
33
34
+ @ Inject
35
+ @ Nonnull
36
+ @ Named ("someComponent" )
37
+ private TestJakartaComponent3 testJakartaComponent3Named ;
38
+
39
+ @ Inject
40
+ @ javax .annotation .Nullable
41
+ @ Named ("someComponentNotExisting" )
42
+ private TestJakartaComponent3 testJakartaComponent3NullableJavax ;
43
+
44
+ @ Inject
45
+ @ jakarta .annotation .Nullable
46
+ @ Named ("someComponentNotExisting" )
47
+ private TestJakartaComponent3 testJakartaComponent3NullableJakarta ;
48
+
33
49
public TestJavaxComponent2 getTestJavaxComponent2 () {
34
50
return testJavaxComponent2 ;
35
51
}
36
52
37
53
public TestJakartaComponent2 getTestJakartaComponent2 () {
38
54
return testJakartaComponent2 ;
39
55
}
56
+
57
+ public TestJakartaComponent3 getTestJakartaComponent3Named () {
58
+ return testJakartaComponent3Named ;
59
+ }
60
+
61
+ public TestJakartaComponent3 getTestJakartaComponent3NullableJavax () {
62
+ return testJakartaComponent3NullableJavax ;
63
+ }
64
+
65
+ public TestJakartaComponent3 getTestJakartaComponent3NullableJakarta () {
66
+ return testJakartaComponent3NullableJakarta ;
67
+ }
40
68
}
Original file line number Diff line number Diff line change
1
+ package org .codehaus .plexus .testing ;
2
+
3
+ /*
4
+ * Licensed to the Apache Software Foundation (ASF) under one
5
+ * or more contributor license agreements. See the NOTICE file
6
+ * distributed with this work for additional information
7
+ * regarding copyright ownership. The ASF licenses this file
8
+ * to you under the Apache License, Version 2.0 (the
9
+ * "License"); you may not use this file except in compliance
10
+ * with the License. You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing,
15
+ * software distributed under the License is distributed on an
16
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ * KIND, either express or implied. See the License for the
18
+ * specific language governing permissions and limitations
19
+ * under the License.
20
+ */
21
+
22
+ import javax .inject .Named ;
23
+
24
+ @ Named ("someComponent" )
25
+ public class TestJakartaComponent3 {}
You can’t perform that action at this time.
0 commit comments