Update mockito usage (#422)

* test build against jdk 17

* Stop using deprecated initMock method
This commit is contained in:
Paul Campbell 2021-07-04 15:39:35 +01:00 committed by GitHub
parent f73a6d66e1
commit c2e3234dd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View file

@ -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 }}

View file

@ -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);
}

View file

@ -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,

View file

@ -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(