@@ -0,0 +1,2098 @@
+/*-%0A * -%5C-%5C-%0A * Spotify Styx Service Common%0A * --%0A * Copyright (C) 2019 Spotify AB%0A * --%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A *      http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * -/-/-%0A */%0A%0Apackage com.spotify.styx.state;%0A%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.mockito.Mockito.verify;%0A%0Aimport com.spotify.styx.model.SequenceEvent;%0Aimport java.lang.reflect.Proxy;%0Aimport java.util.List;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.junit.MockitoJUnitRunner;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class EventConsumerTest %7B%0A  @Mock private EventConsumer eventConsumer1;%0A  @Mock private EventConsumer eventConsumer2;%0A  @Mock private SequenceEvent event;%0A  @Mock private RunState runState;%0A%0A  @Test%0A  public void fanEvent() %7B%0A    var eventConsumer = EventConsumer.fanEvent(List.of(eventConsumer1, eventConsumer2));%0A    eventConsumer.accept(event, runState);%0A    verify(eventConsumer1).accept(event, runState);%0A    verify(eventConsumer2).accept(event, runState);%0A  %7D%0A%0A  @Test%0A  public void tracing() %7B%0A    var eventConsumers = EventConsumer.tracing(List.of(eventConsumer1, eventConsumer2));%0A%0A    assertThat(eventConsumers.size(), is(2));%0A    assertThat(Proxy.isProxyClass(eventConsumers.get(0).getClass()), is(true));%0A    assertThat(Proxy.isProxyClass(eventConsumers.get(1).getClass()), is(true));%0A    eventConsumers.get(0).accept(event, runState);%0A    verify(eventConsumer1).accept(event, runState);%0A    eventConsumers.get(1).accept(event, runState);%0A    verify(eventConsumer2).accept(event, runState);%0A  %7D%0A%7D%0A

add test case