Update mockito usage (#422)
* test build against jdk 17 * Stop using deprecated initMock method
This commit is contained in:
parent
f73a6d66e1
commit
c2e3234dd4
4 changed files with 7 additions and 7 deletions
2
.github/workflows/build-maven.yml
vendored
2
.github/workflows/build-maven.yml
vendored
|
@ -11,7 +11,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
java: [ 11, 16 ]
|
||||
java: [ 11, 16, 17-ea ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: setup-jdk-${{ matrix.java }}
|
||||
|
|
|
@ -18,8 +18,8 @@ public class ReadmeBuilderTest {
|
|||
private String template = "i:%s,ec:%s,es:%s,dc:%s,ds:%s";
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.openMocks(this).close();
|
||||
|
||||
readmeBuilder = new ReadmeBuilder(indexBuilder, ruleLoader);
|
||||
}
|
||||
|
|
|
@ -41,8 +41,8 @@ public class ReadmeWriterTest {
|
|||
private String formattedOutput = UUID.randomUUID().toString();
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws IOException {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.openMocks(this).close();
|
||||
|
||||
readmeWriter =
|
||||
new ReadmeWriter(templateProperties, outputProperties,
|
||||
|
|
|
@ -45,8 +45,8 @@ public class RuleLoaderTest {
|
|||
private String disabledRuleName = "disabled-" + UUID.randomUUID().toString();
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.openMocks(this).close();
|
||||
|
||||
ruleLoader =
|
||||
new RuleLoader(
|
||||
|
|
Loading…
Reference in a new issue