@@ -0,0 +1,2971 @@
+/*%0A * Copyright 2018, 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 io.spine.web.firebase;%0A%0Aimport com.google.protobuf.Any;%0Aimport io.spine.client.Query;%0Aimport io.spine.client.QueryFactory;%0Aimport io.spine.client.TestActorRequestFactory;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.DisplayName;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport javax.servlet.ServletResponse;%0Aimport java.io.IOException;%0Aimport java.io.PrintWriter;%0Aimport java.io.StringWriter;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A/**%0A * @author Dmytro Dashenkov%0A */%0A@DisplayName(%22FirebaseQueryResult should%22)%0Aclass FirebaseQueryResultTest %7B%0A%0A    private static final QueryFactory queryFactory =%0A            TestActorRequestFactory.newInstance(FirebaseQueryResultTest.class).query();%0A%0A    private FirebaseDatabasePath databasePath;%0A%0A    @BeforeEach%0A    void setUp() %7B%0A        final Query query = queryFactory.all(Any.class);%0A        databasePath = FirebaseDatabasePath.allocateForQuery(query);%0A    %7D%0A%0A    @Test%0A    @DisplayName(%22write DB path to servlet response%22)%0A    void testWritePath() throws IOException %7B%0A        final ServletResponse response = mock(ServletResponse.class);%0A        final StringWriter stringWriter = new StringWriter();%0A        final PrintWriter writer = new PrintWriter(stringWriter);%0A        when(response.getWriter()).thenReturn(writer);%0A%0A        final FirebaseQueryResult queryResult = new FirebaseQueryResult(databasePath);%0A        queryResult.writeTo(response);%0A        verify(response).getWriter();%0A%0A        assertEquals(databasePath.toString(), stringWriter.toString());%0A    %7D%0A%0A    @Test%0A    @DisplayName(%22provide a comprehensible string representation%22)%0A    void test_toString() %7B%0A        final FirebaseQueryResult queryResult = new FirebaseQueryResult(databasePath);%0A        assertEquals(databasePath.toString(), queryResult.toString());%0A    %7D%0A%7D%0A

Add tests for `FirebaseQueryResult`.