/*
 * 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.core;

import com.google.common.testing.NullPointerTester;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import static io.spine.testing.DisplayNames.NOT_ACCEPT_NULLS;

@DisplayName("EventClass should")
class EventClassTest {

    @Test
    @DisplayName(NOT_ACCEPT_NULLS)
    void passNullToleranceCheck() {
        new NullPointerTester()
                .testAllPublicStaticMethods(EventClass.class);
    }
}

@@ -1082,16 +1082,125 @@
 Tester;%0A
+import io.spine.test.core.ProjectCreated;%0Aimport io.spine.test.core.ProjectId;%0Aimport io.spine.type.TypeUrl;%0A
 import o
@@ -1330,16 +1330,138 @@
 T_NULLS;
+%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0Aimport static org.junit.jupiter.api.Assertions.assertThrows;
 %0A%0A@Displ
@@ -1693,11 +1693,702 @@
 );%0A    %7D
+%0A%0A    @Test%0A    @DisplayName(%22be constructed from TypeUrl instance%22)%0A    void constructFromTypeUrl() %7B%0A        TypeUrl typeUrl = TypeUrl.from(ProjectCreated.getDescriptor());%0A        EventClass eventClass = EventClass.from(typeUrl);%0A        assertEquals(ProjectCreated.class, eventClass.value());%0A    %7D%0A%0A    @SuppressWarnings(%7B%22CheckReturnValue%22, %22ResultOfMethodCallIgnored%22%7D)%0A    // Method called to throw exception.%0A    @Test%0A    @DisplayName(%22throw IAE when constructing from non-event type URL%22)%0A    void throwOnNonEventType() %7B%0A        TypeUrl typeUrl = TypeUrl.from(ProjectId.getDescriptor());%0A        assertThrows(IllegalArgumentException.class, () -%3E EventClass.from(typeUrl));%0A    %7D
 %0A%7D%0A

Add test for new `EventClass` factory method