rpuch commented on code in PR #2055: URL: https://github.com/apache/ignite-3/pull/2055#discussion_r1192086808
########## modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/asserts/CompletableFutureAssert.java: ########## @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.testframework.asserts; + +import static org.junit.jupiter.api.Assertions.fail; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +/** + * Assertions related to {@link CompletableFuture}. + */ +public class CompletableFutureAssert { Review Comment: A matcher gives a binary answer (matches/does not match) and a description of what does not match. This is a pretty rigid format if you want to make a few assertions. On the other hand, if we just add assertions (throwing an AssertionError) 'inside' a matcher, this looks like an abuse of the idea of a matcher. Each tool is good for its situation. Sometimes a matcher is the right tool, sometimes direct inspection is better. It seems correct to have both tools and use them accordingly. Moreover, this does not bloat the code too much, the class we are discussing is rather small and simple. -- 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]
