Add test case for NoArgsConsumer (#753)

pull/757/head
baymax55 2 years ago committed by GitHub
parent b09c1b52f3
commit f62fcc739c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,5 +17,18 @@
package cn.hippo4j.common.function;
public final class NoArgsConsumerTest {
import cn.hippo4j.common.toolkit.Assert;
import org.junit.jupiter.api.Test;
import java.util.concurrent.atomic.AtomicBoolean;
final class NoArgsConsumerTest {
@Test
void accept() {
AtomicBoolean checkValue = new AtomicBoolean(false);
NoArgsConsumer noArgsConsumer = () -> checkValue.set(true);
noArgsConsumer.accept();
Assert.isTrue(checkValue.get());
}
}

Loading…
Cancel
Save