/*
 * Copyright 2019, TeamDev. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package io.spine.server.event.model;

import io.spine.testing.UtilityClassTest;
import org.junit.jupiter.api.DisplayName;

@DisplayName("RejectionDispatchKey should")
final class RejectionDispatchKeyTest extends UtilityClassTest<RejectionDispatchKey> {

    RejectionDispatchKeyTest() {
        super(RejectionDispatchKey.class);
    }
    
    //TODO:2019-11-27:ysergiichuk: add method tests
}

@@ -1064,74 +1064,593 @@
 ine.
-testing.UtilityClassTest;%0Aimport org.junit.jupiter.api.DisplayName
+core.CommandContext;%0Aimport io.spine.core.Subscribe;%0Aimport io.spine.model.contexts.projects.command.SigCreateProject;%0Aimport io.spine.model.contexts.projects.rejection.ProjectRejections.SigCannotCreateProject;%0Aimport io.spine.server.event.AbstractEventSubscriber;%0Aimport io.spine.server.type.EventClass;%0Aimport io.spine.testing.UtilityClassTest;%0Aimport org.junit.jupiter.api.DisplayName;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport java.lang.reflect.Method;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;%0Aimport static org.junit.jupiter.api.Assertions.assertThrows
 ;%0A%0A@
@@ -1865,63 +1865,1774 @@
   %7D%0A
+%0A
     
-%0A    //TODO:2019-11-27:ysergiichuk: add method 
+@SuppressWarnings(%22ResultOfMethodCallIgnored%22)%0A    @Test%0A    @DisplayName(%22create a valid key%22)%0A    void createValidKey() %7B%0A        assertDoesNotThrow(() -%3E %7B%0A            for (Method method : ValidSubscriber.class.getDeclaredMethods()) %7B%0A                RejectionDispatchKey.of(EventClass.from(SigCannotCreateProject.class), method);%0A            %7D%0A        %7D);%0A    %7D%0A%0A    @SuppressWarnings(%22ResultOfMethodCallIgnored%22)%0A    @Test%0A    @DisplayName(%22not create keys for rejections without a cause%22)%0A    void notCreateKeyForRejectionsWithoutCause() %7B%0A        assertThrows(IllegalArgumentException.class, () -%3E %7B%0A            for (Method method : InvalidSubscriber.class.getDeclaredMethods()) %7B%0A                RejectionDispatchKey.of(EventClass.from(SigCannotCreateProject.class), method);%0A            %7D%0A        %7D);%0A    %7D%0A%0A    priva
 te
+ 
 st
-s
+atic final class InvalidSubscriber extends AbstractEventSubscriber %7B%0A%0A        @Subscribe%0A        void rejectionWithoutCommand(SigCannotCreateProject rejection) %7B%0A            // do nothing.%0A        %7D%0A%0A        @Subscribe%0A        void rejectionWithNonCommandParam(SigCannotCreateProject rejection,%0A                                          CommandContext ctx) %7B%0A            // do nothing.%0A        %7D%0A    %7D%0A%0A    private static final class ValidSubscriber extends AbstractEventSubscriber %7B%0A%0A        @Subscribe%0A        void rejectionWithCommand(SigCannotCreateProject rejection,%0A                                  SigCreateProject command) %7B%0A            // do nothing.%0A        %7D%0A%0A        @Subscribe%0A        void rejectionWithCommandAndCtx(SigCannotCreateProject rejection,%0A                                        SigCreateProject cmd,%0A                                        CommandContext ctx) %7B%0A            // do nothing.%0A        %7D%0A    %7D
 %0A%7D%0A

Add tests