@@ -0,0 +1,3461 @@
+/*%0A * Copyright 2017, TeamDev Ltd. All rights reserved.%0A *%0A * Redistribution and use in source and/or binary forms, with or without%0A * modification, must retain the above copyright notice and the following%0A * disclaimer.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A * %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT%0A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR%0A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT%0A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,%0A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT%0A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,%0A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY%0A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT%0A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0A%0Apackage org.spine3.server.storage.datastore;%0A%0Aimport com.google.common.testing.NullPointerTester;%0Aimport com.google.protobuf.Any;%0Aimport com.google.protobuf.Descriptors;%0Aimport com.google.protobuf.Message;%0Aimport org.junit.Test;%0Aimport org.spine3.type.TypeName;%0Aimport org.spine3.type.TypeUrl;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0A/**%0A * @author Dmytro Dashenkov%0A */%0Apublic class KindShould %7B%0A%0A    @Test%0A    public void be_null_safe() %7B%0A        new NullPointerTester()%0A                .setDefault(TypeUrl.class, TypeUrl.from(Any.getDescriptor()))%0A                .setDefault(Descriptors.Descriptor.class, Any.getDescriptor())%0A                .setDefault(Message.class, Any.getDefaultInstance())%0A                .setDefault(TypeName.class, TypeName.of(Any.class))%0A                .testStaticMethods(Kind.class, NullPointerTester.Visibility.PACKAGE);%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void not_accept_forbidden_prefix() %7B%0A        final String invalidKind = %22__my.invalid.type%22;%0A        Kind.of(invalidKind);%0A    %7D%0A%0A    @Test%0A    public void construct_from_string() %7B%0A        final String type = %22my.custom.type%22;%0A        final Kind kind = Kind.of(type);%0A        assertEquals(type, kind.getValue());%0A    %7D%0A%0A    @Test%0A    public void construct_from_TypeUrl() %7B%0A        final Descriptors.Descriptor descriptor = Any.getDescriptor();%0A        final TypeUrl type = TypeUrl.from(descriptor);%0A        final Kind kind = Kind.of(type);%0A        assertEquals(descriptor.getFullName(), kind.getValue());%0A        assertEquals(type.getTypeName(), kind.getValue());%0A    %7D%0A%0A    @Test%0A    public void construct_from_descriptor() %7B%0A        final Descriptors.Descriptor descriptor = Any.getDescriptor();%0A        final Kind kind = Kind.of(descriptor);%0A        assertEquals(descriptor.getFullName(), kind.getValue());%0A    %7D%0A%0A    @Test%0A    public void construct_from_Message() %7B%0A        final Message message = Any.getDefaultInstance();%0A        final Kind kind = Kind.of(message);%0A        assertEquals(message.getDescriptorForType().getFullName(), kind.getValue());%0A    %7D%0A%0A    @Test%0A    public void construct_from_TypeName() %7B%0A        final Descriptors.Descriptor descriptor = Any.getDescriptor();%0A        final TypeName type = TypeName.from(descriptor);%0A        final Kind kind = Kind.of(type);%0A        assertEquals(descriptor.getFullName(), kind.getValue());%0A        assertEquals(type.value(), kind.getValue());%0A    %7D%0A%7D%0A

Add tests for `Kind`.