Skip to content

Commit

Permalink
[test] Use mockito anyString instead of deprecated anyObject
Browse files Browse the repository at this point in the history
  • Loading branch information
hazendaz committed Dec 18, 2016
1 parent d83b892 commit 7ab1ebb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyObject;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand All @@ -53,7 +53,7 @@ public void setParametersThrowsProperException() throws SQLException {
final BoundSql boundSql = mock(BoundSql.class);

TypeHandler<String> typeHandler = mock(TypeHandler.class);
doThrow(new SQLException("foo")).when(typeHandler).setParameter(any(PreparedStatement.class), anyInt(), (String) anyObject(), any(JdbcType.class));
doThrow(new SQLException("foo")).when(typeHandler).setParameter(any(PreparedStatement.class), anyInt(), anyString(), any(JdbcType.class));
ParameterMapping parameterMapping = new ParameterMapping.Builder(mappedStatement.getConfiguration(), "prop", typeHandler).build();
List<ParameterMapping> parameterMappings = Collections.singletonList(parameterMapping);
when(boundSql.getParameterMappings()).thenReturn(parameterMappings);
Expand Down

0 comments on commit 7ab1ebb

Please sign in to comment.