Skip to content

Commit 25cf9ff

Browse files
committed
Update CHANGELOG with the new context aware values provider
#44
1 parent e312198 commit 25cf9ff

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
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+
137
## 1.14
238

339
- Fixed multiple constructors error when this library is used with Powermock.

0 commit comments

Comments
 (0)