Skip to content

Commit 5b8c24e

Browse files
committed
test fix
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent a08d205 commit 5b8c24e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

framework/db/src/test/java/com/cloud/utils/DbUtilTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public void cleanup() throws SecurityException, NoSuchFieldException, IllegalArg
150150
@Test
151151
public void getGlobalLock() throws SQLException {
152152
Mockito.when(dataSource.getConnection()).thenReturn(connection);
153-
Mockito.when(connection.prepareStatement(Matchers.anyString())).thenReturn(preparedStatement);
153+
Mockito.when(connection.prepareStatement(Mockito.anyString())).thenReturn(preparedStatement);
154154
Mockito.when(preparedStatement.executeUpdate()).thenReturn(1);
155155

156156
Assert.assertTrue(DbUtil.getGlobalLock("TEST", 600));
@@ -163,13 +163,13 @@ public void getGlobalLock() throws SQLException {
163163
public void getGlobalLockTimeout() throws SQLException {
164164
Mockito.when(dataSource.getConnection()).thenReturn(connection);
165165

166-
Mockito.when(connection.prepareStatement(Matchers.anyString())).thenReturn(preparedStatement);
166+
Mockito.when(connection.prepareStatement(Mockito.anyString())).thenReturn(preparedStatement);
167167
Mockito.when(preparedStatement.executeUpdate()).thenReturn(0);
168168

169169
final int tries = 2;
170170
Assert.assertFalse(DbUtil.getGlobalLock("TEST", tries));
171171

172-
Mockito.verify(connection, Mockito.times(tries)).prepareStatement(Matchers.anyString());
172+
Mockito.verify(connection, Mockito.times(tries)).prepareStatement(Mockito.anyString());
173173
Mockito.verify(preparedStatement, Mockito.times(tries)).close();
174174
Mockito.verify(connection).close();
175175

@@ -235,7 +235,7 @@ void releaseGlobalLockNotexisting() throws SQLException {
235235

236236
@Test
237237
public void releaseGlobalLock() throws SQLException {
238-
Mockito.when(connection.prepareStatement(Matchers.anyString())).thenReturn(preparedStatement);
238+
Mockito.when(connection.prepareStatement(Mockito.anyString())).thenReturn(preparedStatement);
239239
Mockito.when(preparedStatement.executeUpdate()).thenReturn(1);
240240

241241
connectionMap.put("testLock", connection);

0 commit comments

Comments
 (0)