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
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";
21 void shouldCreateBuilder() {
22 Assertions
.assertNotNull(Rule
.called("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
);