update copyright
[reguloj.git] / src / test / java / wtf / metio / reguloj / RuleTest.java
blobc85d471de743b7bb626a360fa44ec1b0eff52e28
1 /*
2 * This file is part of reguloj. It is subject to the license terms in the LICENSE file found in the top-level
3 * directory of this distribution and at https://creativecommons.org/publicdomain/zero/1.0/. No part of reguloj,
4 * including this file, may be copied, modified, propagated, or distributed except according to the terms contained
5 * in the LICENSE file.
6 */
8 package wtf.metio.reguloj;
10 import java.util.function.Consumer;
11 import java.util.function.Predicate;
12 import org.junit.jupiter.api.Assertions;
13 import org.junit.jupiter.api.Test;
14 import org.mockito.Mockito;
16 final class RuleTest {
18 private static final String NAME = "test rule";
20 @Test
21 void shouldCreateBuilder() {
22 Assertions.assertNotNull(Rule.called("test"));
25 @Test
26 void shouldCreateRule() {
27 final var builder = Rule.<Context<Object>>called("test");
28 builder.called(NAME).when(Mockito.mock(Predicate.class));
29 final var rule = builder.then(Mockito.mock(Consumer.class));
30 Assertions.assertNotNull(rule);