@@ -0,0 +1,3566 @@
+/*%0A * Copyright 2020, TeamDev. 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 io.spine.query;%0A%0Aimport io.spine.testing.Tests;%0Aimport org.junit.jupiter.api.DisplayName;%0Aimport org.junit.jupiter.api.Nested;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0Aimport static io.spine.testing.Tests.nullRef;%0Aimport static org.junit.jupiter.api.Assertions.assertThrows;%0A%0A@DisplayName(%22%60RecordColumn%60 should%22)%0Aclass RecordColumnTest %7B%0A%0A    @Test%0A    @DisplayName(%22allow creating new instances%22)%0A    void allowCreation() %7B%0A        String name = %22description%22;%0A        String description = %22some description%22;%0A        RecordColumn%3CManufacturer, String%3E column = new RecordColumn%3C%3E(name,%0A                                                                       String.class,%0A                                                                       (r) -%3E description);%0A        assertThat(column).isNotNull();%0A        assertThat(column.name().value()).isEqualTo(name);%0A        assertThat(column.type()).isEqualTo(String.class);%0A        assertThat(column.valueIn(Manufacturer.getDefaultInstance())).isEqualTo(description);%0A    %7D%0A%0A    @Nested%0A    @DisplayName(%22prevent from passing%22)%0A    final class Prevent %7B%0A%0A        @Test%0A        @DisplayName(%22empty or %60null%60 column name into ctor%22)%0A        void emptyOrNullColumnName() %7B%0A            assertThrows(IllegalArgumentException.class,%0A                         () -%3E new RecordColumn%3C%3E(%22%22, String.class, (r) -%3E %22%22));%0A%0A            assertThrows(NullPointerException.class,%0A                         () -%3E new RecordColumn%3CManufacturer, String%3E(Tests.%3CString%3EnullRef(),%0A                                                                      String.class,%0A                                                                      (r) -%3E %22%22));%0A        %7D%0A%0A        @Test%0A        @DisplayName(%22%60null%60 value type into ctor%22)%0A        void nullValueType() %7B%0A            assertThrows(NullPointerException.class,%0A                         () -%3E new RecordColumn%3CManufacturer, String%3E(%22isin%22,%0A                                                                      nullRef(),%0A                                                                      (r) -%3E %22%22));%0A        %7D%0A%0A        @Test%0A        @DisplayName(%22%60null%60 getter into ctor%22)%0A        void nullGetter() %7B%0A            assertThrows(NullPointerException.class,%0A                         () -%3E new RecordColumn%3CManufacturer, String%3E(%22isin%22,%0A                                                                      String.class,%0A                                                                      nullRef()));%0A        %7D%0A    %7D%0A%7D%0A

Test `RecordColumn`.