Toggle navigation
Home
java.sql.PreparedStatement to java.lang.String
No. of Instances - 5
No. of Commits - 1
No. of Projects - {'flink'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Jdk -> Jdk
Mapping:
Other
(String)invocation.getArguments()[0]
to
sql
"INSERT INTO kvstate_" + stateId + " (id, k, v) VALUES (?,?,?) "+ "ON DUPLICATE KEY UPDATE v=? "
to
"INSERT INTO kvstate_" + stateId + " (id, k, v) VALUES (?,?,?) "+ "ON DUPLICATE KEY UPDATE v=? "
"SELECT v" + " FROM kvstate_" + stateId + " WHERE k = ?"+ " AND id <= ?"+ " ORDER BY id DESC LIMIT 1"
to
"SELECT v" + " FROM kvstate_" + stateId + " WHERE k = ?"+ " AND id <= ?"+ " ORDER BY id DESC LIMIT 1"
"INSERT INTO kvstate_" + stateId + " (id, k, v) VALUES (?,?,?)"
to
"INSERT INTO kvstate_" + stateId + " (id, k, v) VALUES (?,?,?)"
Add or Remove Method invocation
doAnswer(invocation -> { PreparedStatement statement=(PreparedStatement)invocation.callRealMethod(); PreparedStatement statementSpy=Mockito.spy(statement); preparedStatementStatisticsMap.putIfAbsent(statementSpy,new PreparedStatementStatistics(sql)); doAnswer(_invocation -> { Object mock=_invocation.getMock(); preparedStatementStatisticsMap.get(mock).executeUpdateCount++; return _invocation.callRealMethod(); } ).when(statementSpy).executeUpdate(); doAnswer(_invocation -> { Object mock=_invocation.getMock(); preparedStatementStatisticsMap.get(mock).addBatchCount++; return _invocation.callRealMethod(); } ).when(statementSpy).addBatch(); doAnswer(_invocation -> { Object mock=_invocation.getMock(); preparedStatementStatisticsMap.get(mock).executeBatchCount++; return _invocation.callRealMethod(); } ).when(statementSpy).executeBatch(); return statementSpy; } ).when(connectionSpy)
to
doAnswer(invocation -> { PreparedStatement statement=(PreparedStatement)invocation.callRealMethod(); PreparedStatement statementSpy=Mockito.spy(statement); String sql=(String)invocation.getArguments()[0]; preparedStatementStatisticsMap.put(sql,statementSpy); return statementSpy; } ).when(connectionSpy)