2
2
3
3
import static org .junit .jupiter .api .Assertions .*;
4
4
5
- import java .lang .reflect .Field ;
6
5
import java .util .ArrayList ;
7
6
import java .util .List ;
8
7
import java .util .Map ;
9
8
import java .util .Set ;
10
9
import org .apache .maven .model .Developer ;
11
- import org .apache .maven .plugin .MojoExecutionException ;
12
10
import org .cyclonedx .model .Component ;
13
11
import org .cyclonedx .model .Dependency ;
14
12
import org .cyclonedx .model .OrganizationalContact ;
15
13
import org .cyclonedx .model .OrganizationalEntity ;
16
- import org .cyclonedx .model .organization .PostalAddress ;
17
14
import org .junit .jupiter .api .DisplayName ;
18
15
import org .junit .jupiter .api .Test ;
19
16
@@ -27,7 +24,7 @@ private static class BaseCycloneDxMojoImpl extends BaseCycloneDxMojo {
27
24
28
25
@ Override
29
26
protected String extractComponentsAndDependencies (Set <String > topLevelComponents ,
30
- Map <String , Component > components , Map <String , Dependency > dependencies ) throws MojoExecutionException {
27
+ Map <String , Component > components , Map <String , Dependency > dependencies ) {
31
28
return "" ;
32
29
}
33
30
}
@@ -106,27 +103,4 @@ void isNotNullOrEmpty() {
106
103
assertTrue (mojo .isNotNullOrEmpty (value ));
107
104
}
108
105
109
-
110
-
111
- /**
112
- * Inject a parameter value to a superclass (even private parameters).
113
- * <p>example:</p>
114
- * <br>{@code class B extends A;}
115
- * <br>{@code class A { private Type a; } }
116
- * <br>
117
- * <br>{@code setParentParameter(new B(), "a", new Type()); }
118
- *
119
- * @param cc The class instance
120
- * @param fieldName The field name
121
- * @param value The value
122
- * @throws NoSuchFieldException If the field does not exist
123
- * @throws IllegalAccessException If the value is not able to be modified
124
- */
125
- public static void setParentParameter (Object cc , String fieldName , Object value )
126
- throws NoSuchFieldException , IllegalAccessException {
127
- Field field = cc .getClass ().getSuperclass ().getDeclaredField (fieldName );
128
- field .setAccessible (true );
129
- field .set (cc , value );
130
- }
131
-
132
106
}
0 commit comments