Skip to content

Commit ce7f916

Browse files
committed
Removing hamcrest and adding hamcrest-core from junit.
1 parent 6415db0 commit ce7f916

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ dependencies {
2525
// Test dependencies
2626
compile 'org.mockito:mockito-core:4.3.1'
2727
compile 'commons-io:commons-io:2.11.0'
28-
compile group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
2928

3029
// Module dependencies
3130
compile 'com.zaxxer:HikariCP:5.0.1'
@@ -39,7 +38,7 @@ dependencies {
3938
compile 'com.sap.cloud.db.jdbc:ngdbc:2.4.76'
4039

4140
// UnitTesting
42-
compile group: 'junit', name: 'junit', version: '4.13.2', { transitive = false }
41+
compile group: 'junit', name: 'junit', version: '4.13.2'
4342
compile group: 'org.apache.httpcomponents', name: 'httpcore-osgi', version: '4.4.15', { transitive = false }
4443
compile group: 'org.apache.httpcomponents', name: 'httpclient-osgi', version: '4.5.13', { transitive = false }
4544

javasource/databaseconnectortest/test/ConnectionManagerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package databaseconnectortest.test;
22

33
import static org.junit.Assert.assertNotEquals;
4-
import static org.mockito.Matchers.anyString;
4+
import static org.mockito.ArgumentMatchers.anyString;
55
import static org.mockito.Mockito.times;
66

77
import java.sql.Connection;

javasource/databaseconnectortest/test/JdbcConnectorTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public void testObjectInstantiatorException() throws SQLException, DatabaseConne
114114
when(preparedStatement.executeQuery()).thenReturn(resultSet);
115115
when(resultSet.getMetaData()).thenReturn(resultSetMetaData);
116116
when(resultSet.next()).thenReturn(true, false);
117-
when(objectInstantiator.instantiate(anyObject(), anyString())).thenThrow(testException);
117+
when(objectInstantiator.instantiate(any(), anyString())).thenThrow(testException);
118118

119119
try {
120120
jdbcConnector.executeQuery(jdbcUrl, userName, password, mockIMetaObject(), sqlQuery, context);
@@ -152,7 +152,7 @@ public void testSomeResults() throws SQLException, DatabaseConnectorException {
152152
when(connectionManager.getConnection(anyString(), anyString(), anyString())).thenReturn(connection);
153153
when(preparedStatementCreator.create(anyString(), eq(connection))).thenReturn(preparedStatement);
154154
when(preparedStatement.executeQuery()).thenReturn(resultSet);
155-
when(objectInstantiator.instantiate(anyObject(), anyString())).thenReturn(resultObject);
155+
when(objectInstantiator.instantiate(any(), anyString())).thenReturn(resultObject);
156156
when(resultSetMetaData.getColumnName(anyInt())).thenReturn("a", "b");
157157
when(resultSetMetaData.getColumnCount()).thenReturn(2);
158158
when(resultSet.getMetaData()).thenReturn(resultSetMetaData);
@@ -188,7 +188,7 @@ public void testSomeResultsWithTwoColumns() throws SQLException, DatabaseConnect
188188
when(connectionManager.getConnection(anyString(), anyString(), anyString())).thenReturn(connection);
189189
when(preparedStatementCreator.create(anyString(), eq(connection))).thenReturn(preparedStatement);
190190
when(preparedStatement.executeQuery()).thenReturn(resultSet);
191-
when(objectInstantiator.instantiate(anyObject(), anyString())).thenReturn(resultObject1, resultObject2);
191+
when(objectInstantiator.instantiate(any(), anyString())).thenReturn(resultObject1, resultObject2);
192192
when(resultSetMetaData.getColumnCount()).thenReturn(2);
193193
when(resultSetMetaData.getColumnName(1)).thenReturn(columnName1);
194194
when(resultSetMetaData.getColumnName(2)).thenReturn(columnName2);
@@ -217,7 +217,7 @@ public void testResultForBoolean() throws SQLException, DatabaseConnectorExcepti
217217
when(connectionManager.getConnection(anyString(), anyString(), anyString())).thenReturn(connection);
218218
when(preparedStatementCreator.create(anyString(), eq(connection))).thenReturn(preparedStatement);
219219
when(preparedStatement.executeQuery()).thenReturn(resultSet);
220-
when(objectInstantiator.instantiate(anyObject(), anyString())).thenReturn(resultObject);
220+
when(objectInstantiator.instantiate(any(), anyString())).thenReturn(resultObject);
221221

222222
when(resultSetMetaData.getColumnCount()).thenReturn(1);
223223
when(resultSetMetaData.getColumnName(1)).thenReturn("Boolean");
@@ -244,7 +244,7 @@ public void testNoResults() throws Exception {
244244
when(connectionManager.getConnection(anyString(), anyString(), anyString())).thenReturn(connection);
245245
when(preparedStatementCreator.create(anyString(), eq(connection))).thenReturn(preparedStatement);
246246
when(preparedStatement.executeQuery()).thenReturn(resultSet);
247-
when(objectInstantiator.instantiate(anyObject(), anyString())).thenReturn(resultObject);
247+
when(objectInstantiator.instantiate(any(), anyString())).thenReturn(resultObject);
248248
when(resultSetMetaData.getColumnCount()).thenReturn(2);
249249
when(resultSetMetaData.getColumnName(1)).thenReturn("a");
250250
when(resultSetMetaData.getColumnName(2)).thenReturn("b");
-120 KB
Binary file not shown.
44 KB
Binary file not shown.

0 commit comments

Comments
 (0)