@@ -0,0 +1,2290 @@
+// Copyright 2015 Eivind Vegsundv%C3%A5g%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A// http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A%0Apackage ninja.eivind.hotsreplayuploader.repositories;%0A%0Aimport com.j256.ormlite.jdbc.JdbcConnectionSource;%0Aimport com.j256.ormlite.support.ConnectionSource;%0Aimport com.j256.ormlite.table.TableUtils;%0Aimport ninja.eivind.hotsreplayuploader.models.ReplayFile;%0Aimport ninja.eivind.hotsreplayuploader.models.Status;%0Aimport ninja.eivind.hotsreplayuploader.models.UploadStatus;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.io.File;%0Aimport java.util.Collections;%0A%0Aimport static org.junit.Assert.*;%0Aimport static org.mockito.Mockito.*;%0A%0Apublic class OrmLiteFileRepositoryTest %7B%0A%0A    private OrmLiteFileRepository repository;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        ConnectionSource connectionSource = new JdbcConnectionSource(%22jdbc:h2:mem:test%22);%0A        TableUtils.createTable(connectionSource, ReplayFile.class);%0A        TableUtils.createTable(connectionSource, UploadStatus.class);%0A%0A        repository = new OrmLiteFileRepository(connectionSource);%0A        repository.initialize();%0A    %7D%0A%0A    @Test%0A    public void testUpdateReplay() throws Exception %7B%0A        final ReplayFile replayFile = new ReplayFile(mock(File.class));%0A        final UploadStatus status = new UploadStatus(%22test%22, Status.EXCEPTION);%0A        replayFile.addStatuses(Collections.singletonList(status));%0A        repository.updateReplay(replayFile);%0A        assertNotNull(replayFile.getStatus());%0A%0A        status.setStatus(Status.UPLOADED);%0A        repository.updateReplay(replayFile);%0A%0A        final Status expected = Status.UPLOADED;%0A        final Status actual = repository.findById(replayFile.getId()).getStatus();%0A%0A        assertSame(%22Updated status is persistent.%22, expected, actual);%0A    %7D%0A%7D%0A

add failing test to verify #107