@@ -0,0 +1,3895 @@
+/*%0A * Copyright 2016, 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.stand;%0A%0Aimport com.google.protobuf.Any;%0Aimport org.junit.Test;%0Aimport org.spine3.base.Queries;%0Aimport org.spine3.client.Subscription;%0Aimport org.spine3.client.Target;%0Aimport org.spine3.protobuf.AnyPacker;%0Aimport org.spine3.protobuf.TypeUrl;%0Aimport org.spine3.test.aggregate.Project;%0Aimport org.spine3.test.aggregate.ProjectId;%0A%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0A%0A/**%0A * @author Dmytro Dashenkov%0A */%0Apublic class SubscriptionRecordShould %7B%0A%0A    @Test%0A    public void match_record_to_given_parameters() %7B%0A        final SubscriptionRecord matchingRecord = new SubscriptionRecord(Given.subscription(),%0A                                                                         Given.target(),%0A                                                                         Given.TYPE);%0A%0A        final Project entityState = Project.getDefaultInstance();%0A        final Any wrappedState = AnyPacker.pack(entityState);%0A        final ProjectId redundantId = ProjectId.getDefaultInstance();%0A%0A        final boolean matchResult = matchingRecord.matches(Given.TYPE, redundantId, wrappedState);%0A%0A        assertTrue(matchResult);%0A    %7D%0A%0A    @Test%0A    public void be_equal_if_has_same_subscription() %7B%0A        final Subscription oneSubscription = Given.subscription();%0A        final Subscription otherSubscription = Subscription.newBuilder()%0A                                                           .setId(%22breaking-id%22)%0A                                                           .build();%0A%0A        @SuppressWarnings(%22QuestionableName%22)%0A        final SubscriptionRecord one = new SubscriptionRecord(oneSubscription,%0A                                                              Given.target(),%0A                                                              Given.TYPE);%0A%0A        final SubscriptionRecord similar = new SubscriptionRecord(otherSubscription,%0A                                                                  Given.target(),%0A                                                                  Given.TYPE);%0A%0A        final SubscriptionRecord same = new SubscriptionRecord(oneSubscription,%0A                                                               Given.target(),%0A                                                               Given.TYPE);%0A%0A        assertFalse(one.equals(similar));%0A        assertTrue(one.equals(same));%0A    %7D%0A%0A    @SuppressWarnings(%22UtilityClass%22)%0A    private static class Given %7B%0A%0A        private static final TypeUrl TYPE = TypeUrl.of(Project.class);%0A%0A        private static Target target() %7B%0A            final Target target = Queries.Targets.allOf(Project.class);%0A%0A            return target;%0A        %7D%0A%0A        private static Subscription subscription() %7B%0A            final Subscription subscription = Subscription.getDefaultInstance();%0A%0A            return subscription;%0A        %7D%0A    %7D%0A%7D%0A

Add tests for SubscriptionRecord.