oleg-vlsk commented on code in PR #11793: URL: https://github.com/apache/ignite/pull/11793#discussion_r1915934895
########## modules/core/src/test/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsThinClientTest.java: ########## @@ -171,6 +178,62 @@ public void testCacheOperation() throws Exception { checkCacheOperation(CACHE_GET_AND_REMOVE, cache -> cache.getAndRemove(5)); } + /** + * Cache {@link TcpClientCache#putAllConflict} and {@link TcpClientCache#removeAllConflict} operations performed. + * @throws Exception If failed. + */ + @Test + public void testCacheAllConflictOperations() throws Exception { + checkCacheAllConflictOperations(false); Review Comment: Looks much better now, but I believe that moving each individual check into its own test method would make it even more convenient. Please consider something like this: ``` public void testPutAllConflict() { checkCacheOperation(CACHE_PUT_ALL_CONFLICT, cache -> cache.putAllConflict(getPutMap())); } ``` for non-async methods with something like for getting your maps: ``` private Map<?, T3<?, GridCacheVersion, Long>> getPutMap() { return F.asMap(key, new T3<>(...)); } private Map<?, GridCacheVersion> getRemoveMap() { return F.asMap(key, confl); } ``` And maybe something like ``` public void testPutAllConflictOperationsAsync() throws Exception { runAsyncOp(CACHE_PUT_ALL_CONFLICT); } ``` For async operations with ``` public void runAsyncOp(OperationType type) { checkCacheOperation(type, cache -> { try { if (type == CACHE_PUT_ALL_CONFLICT) cache.putAllConflictAsync(getPutMap()).get(); else if (type == CACHE_REMOVE_ALL_CONFLICT) cache.removeAllConflictAsync(getRemoveMap()).get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } }); } ``` To avoid code duplication for try-catch. -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org