Skip to content

Commit 4cb0ae1

Browse files
committed
[tests] Update deprecated initMocks to openMocks
1 parent 22d236c commit 4cb0ae1

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/test/java/org/mybatis/spring/batch/MyBatisBatchItemWriterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2023 the original author or authors.
2+
* Copyright 2010-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ class MyBatisBatchItemWriterTest {
5454

5555
@BeforeEach
5656
void setUp() {
57-
MockitoAnnotations.initMocks(this);
57+
MockitoAnnotations.openMocks(this);
5858
}
5959

6060
@Test

src/test/java/org/mybatis/spring/batch/MyBatisCursorItemReaderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2022 the original author or authors.
2+
* Copyright 2010-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@ class MyBatisCursorItemReaderTest {
5050

5151
@BeforeEach
5252
void setUp() {
53-
MockitoAnnotations.initMocks(this);
53+
MockitoAnnotations.openMocks(this);
5454
}
5555

5656
@Test

src/test/java/org/mybatis/spring/batch/builder/MyBatisBatchItemWriterBuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2023 the original author or authors.
2+
* Copyright 2010-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -61,7 +61,7 @@ class MyBatisBatchItemWriterBuilderTest {
6161

6262
@BeforeEach
6363
void setUp() {
64-
MockitoAnnotations.initMocks(this);
64+
MockitoAnnotations.openMocks(this);
6565
{
6666
Configuration configuration = new Configuration();
6767
Environment environment = new Environment("unittest", new JdbcTransactionFactory(), dataSource);

src/test/java/org/mybatis/spring/batch/builder/MyBatisCursorItemReaderBuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2022 the original author or authors.
2+
* Copyright 2010-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ class MyBatisCursorItemReaderBuilderTest {
5454

5555
@BeforeEach
5656
void setUp() {
57-
MockitoAnnotations.initMocks(this);
57+
MockitoAnnotations.openMocks(this);
5858

5959
Mockito.when(this.sqlSessionFactory.openSession(ExecutorType.SIMPLE)).thenReturn(this.sqlSession);
6060
Mockito.when(this.cursor.iterator()).thenReturn(getFoos().iterator());

src/test/java/org/mybatis/spring/batch/builder/MyBatisPagingItemReaderBuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2022 the original author or authors.
2+
* Copyright 2010-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -58,7 +58,7 @@ class MyBatisPagingItemReaderBuilderTest {
5858

5959
@BeforeEach
6060
void setUp() {
61-
MockitoAnnotations.initMocks(this);
61+
MockitoAnnotations.openMocks(this);
6262

6363
Configuration configuration = new Configuration();
6464
Environment environment = new Environment("unittest", new JdbcTransactionFactory(), dataSource);

0 commit comments

Comments
 (0)