sandynz commented on pull request #15775:
URL: https://github.com/apache/shardingsphere/pull/15775#issuecomment-1059050166
> > Could we verify certain `sql` is passed in
`connection.prepareStatement(sql)`, e.g.
> > ```
> > SELECT BIT_XOR(CAST(CRC32(`fieldOne`) AS UNSIGNED)) AS checksum FROM
`tableName`
> > ```
>
> Dear @sandynz,
>
> Thank you for your comments and your collaboration.
>
> Regarding the other comment, I resolved them and I think now we are ready.
But regarding the mentioned comment, is not clear to me how we could improve it.
>
> I am looking forward to your feedback, and I remain always at your
disposal.
>
> Best Regards, Panagiotis Parthenis
Hi @pparthenhs , you could try `Mockito.verify`, refer to
`AbstractImporterTest` for more details, an example:
```
@Test
public void assertWriteInsertDataRecord() throws SQLException {
DataRecord insertRecord = getDataRecord("INSERT");
when(pipelineSqlBuilder.buildInsertSQL(insertRecord)).thenReturn(INSERT_SQL);
when(connection.prepareStatement(INSERT_SQL)).thenReturn(preparedStatement);
when(channel.fetchRecords(anyInt(),
anyInt())).thenReturn(mockRecords(insertRecord));
jdbcImporter.run();
verify(preparedStatement).setObject(1, 1);
verify(preparedStatement).setObject(2, 10);
verify(preparedStatement).setObject(3, "INSERT");
verify(preparedStatement).addBatch();
}
```
If it doesn't work, you could ignore it for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]