@@ -0,0 +1,2818 @@
+/*%0A * Copyright 2015, 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.gae.datastore;%0A%0Aimport com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;%0Aimport com.google.appengine.tools.development.testing.LocalServiceTestHelper;%0Aimport com.google.protobuf.Message;%0Aimport org.junit.AfterClass;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport org.spine3.TypeName;%0Aimport org.spine3.base.CommandRequest;%0Aimport org.spine3.protobuf.JsonFormat;%0Aimport org.spine3.testutil.CommandRequestFactory;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0A@SuppressWarnings(%22InstanceMethodNamingConvention%22)%0Apublic class DataStoreHelperShould %7B%0A%0A    private static final String SOME_RANDOM_STRING = %22123qwe%22;%0A%0A    private static final LocalServiceTestHelper testHelper =%0A            new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());%0A    private static DataStoreHelper dataStoreHelper;%0A%0A    private final TypeName commandTypeName = TypeName.of(CommandRequest.getDescriptor());%0A%0A    @BeforeClass%0A    public static void setUp() %7B%0A        dataStoreHelper = new DataStoreHelper();%0A        testHelper.setUp();%0A    %7D%0A%0A    @AfterClass%0A    public static void tearDown() %7B%0A        testHelper.tearDown();%0A    %7D%0A%0A    @Test%0A    public void write_correctly() %7B%0A%0A        final CommandRequest commandRequest = CommandRequestFactory.create();%0A        final String stringId = JsonFormat.printToString(commandRequest.getContext().getCommandId());%0A%0A        dataStoreHelper.put(Converters.convert(commandRequest));%0A        final Message readCommandRequest = dataStoreHelper.read(commandTypeName, stringId);%0A        assertEquals(commandRequest, readCommandRequest);%0A    %7D%0A%0A    @Test(expected = MissingEntityException.class)%0A    public void fail_read_on_wrong_key() %7B%0A        dataStoreHelper.read(commandTypeName, SOME_RANDOM_STRING);%0A    %7D%0A%7D

Add tests