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
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java: [ 11, 16 ]
|
java: [ 11, 16, 17-ea ]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: setup-jdk-${{ matrix.java }}
|
- 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";
|
private String template = "i:%s,ec:%s,es:%s,dc:%s,ds:%s";
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() {
|
public void setUp() throws Exception {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.openMocks(this).close();
|
||||||
|
|
||||||
readmeBuilder = new ReadmeBuilder(indexBuilder, ruleLoader);
|
readmeBuilder = new ReadmeBuilder(indexBuilder, ruleLoader);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,8 @@ public class ReadmeWriterTest {
|
||||||
private String formattedOutput = UUID.randomUUID().toString();
|
private String formattedOutput = UUID.randomUUID().toString();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() throws IOException {
|
public void setUp() throws Exception {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.openMocks(this).close();
|
||||||
|
|
||||||
readmeWriter =
|
readmeWriter =
|
||||||
new ReadmeWriter(templateProperties, outputProperties,
|
new ReadmeWriter(templateProperties, outputProperties,
|
||||||
|
|
|
@ -45,8 +45,8 @@ public class RuleLoaderTest {
|
||||||
private String disabledRuleName = "disabled-" + UUID.randomUUID().toString();
|
private String disabledRuleName = "disabled-" + UUID.randomUUID().toString();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() {
|
public void setUp() throws Exception {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.openMocks(this).close();
|
||||||
|
|
||||||
ruleLoader =
|
ruleLoader =
|
||||||
new RuleLoader(
|
new RuleLoader(
|
||||||
|
|
Loading…
Reference in a new issue