pvary commented on a change in pull request #2119:
URL: https://github.com/apache/iceberg/pull/2119#discussion_r565057472
##########
File path:
hive-metastore/src/test/java/org/apache/iceberg/hive/TestClientPool.java
##########
@@ -51,4 +81,918 @@ protected void close(Object client) {
}
}
+
+ private static class MockHiveClientPool extends ClientPool<IMetaStoreClient,
Exception> {
+
+ MockHiveClientPool(int poolSize, Class<? extends Exception> reconnectExc) {
+ super(poolSize, reconnectExc);
+ }
+
+ @Override
+ protected IMetaStoreClient newClient() {
+ return new MockMetaStoreFailureClient();
Review comment:
Instead of creating our own client we might want to use Mockito to
generate an object for us. Some good examles can be found here:
https://github.com/apache/iceberg/blob/915a17573f2819992c866c9a76fbbf9612ca1d4a/aws/src/test/java/org/apache/iceberg/aws/glue/GlueCatalogTest.java
We can say that if a given method is called then return the given value. We
can even define that the 2nd call should return another value.
Also when checking the results we can check the number of calls for the
given methods.
Thanks for creating the test case!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]