File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## 1.15
2
+
3
+ - Add context aware version of [ ` TestParameterValuesProvider ` ] (
4
+ https://google.github.io/TestParameterInjector/docs/latest/com/google/testing/junit/testparameterinjector/TestParameterValuesProvider.html ).
5
+ It is the same as the old [ ` TestParameter.TestParameterValuesProvider ` ] (
6
+ https://google.github.io/TestParameterInjector/docs/latest/com/google/testing/junit/testparameterinjector/TestParameter.TestParameterValuesProvider.html ),
7
+ except that ` provideValues() ` was changed to ` provideValues(Context) ` where
8
+ [ ` Context ` ] (
9
+ https://google.github.io/TestParameterInjector/docs/latest/com/google/testing/junit/testparameterinjector/TestParameterValuesProvider.Context.html )
10
+ contains the test class and the other annotations. This allows for more generic
11
+ providers that take into account custom annotations with extra data, or the
12
+ implementation of abstract methods on a base test class.
13
+
14
+ Example usage:
15
+
16
+ ``` java
17
+ import com.google.testing.junit.testparameterinjector.TestParameterValuesProvider ;
18
+
19
+ private static final class MyProvider extends TestParameterValuesProvider {
20
+ @Override
21
+ public List<?> provideValues (Context context ) throws Exception {
22
+ var testInstance = context. testClass(). getDeclaredConstructor(). newInstance();
23
+ var fooList = ((MyBaseTestClass ) testInstance). getFooList();
24
+ // ...
25
+
26
+ // OR
27
+
28
+ var fooList = context. getOtherAnnotation(MyCustomAnnotation . class). fooList();
29
+ // ...
30
+ }
31
+ }
32
+ ```
33
+
34
+ - Fixed some theoretical non-determinism that could arise from Java reflection
35
+ methods
36
+
1
37
## 1.14
2
38
3
39
- Fixed multiple constructors error when this library is used with Powermock.
You can’t perform that action at this time.
0 commit comments