@@ -0,0 +1,3029 @@
+/*%0A * Copyright (c) 2015 Ushahidi Inc%0A *%0A * This program is free software: you can redistribute it and/or modify it under%0A *  the terms of the GNU Affero General Public License as published by the Free%0A *  Software Foundation, either version 3 of the License, or (at your option)%0A *  any later version.%0A *%0A *  This program is distributed in the hope that it will be useful, but WITHOUT%0A *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS%0A *  FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.%0A *%0A *  You should have received a copy of the GNU Affero General Public License%0A *  along with this program in the file LICENSE-AGPL. If not, see%0A *  https://www.gnu.org/licenses/agpl-3.0.html%0A */%0A%0Apackage com.ushahidi.android.domain.usecase.post;%0A%0Aimport com.addhen.android.raiburari.domain.executor.PostExecutionThread;%0Aimport com.addhen.android.raiburari.domain.executor.ThreadExecutor;%0Aimport com.ushahidi.android.BuildConfig;%0Aimport com.ushahidi.android.domain.repository.PostRepository;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations;%0Aimport org.robolectric.RobolectricGradleTestRunner;%0Aimport org.robolectric.annotation.Config;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0Aimport static com.google.common.truth.Truth.assert_;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.verifyNoMoreInteractions;%0A%0A/**%0A * Tests %7B@link GetPostUsecase%7D%0A *%0A * @author Ushahidi Team %3Cteam@ushahidi.com%3E%0A */%0A@RunWith(RobolectricGradleTestRunner.class)%0A@Config(sdk = 21, constants = BuildConfig.class)%0Apublic class GetPostUsecaseTest %7B%0A%0A    @Mock%0A    private PostRepository mMockListRepository;%0A%0A    @Mock%0A    private ThreadExecutor mMockThreadExecutor;%0A%0A    @Mock%0A    private PostExecutionThread mMockPostExecutionThread;%0A%0A    private GetPostUsecase mGetPostUsecase;%0A%0A    @Before%0A    public void setUp() %7B%0A        MockitoAnnotations.initMocks(this);%0A        mGetPostUsecase = new GetPostUsecase(mMockListRepository, mMockThreadExecutor,%0A                mMockPostExecutionThread);%0A    %7D%0A%0A    @Test%0A    public void shouldSuccessfullyFetchFromOnline() %7B%0A        mGetPostUsecase.setGetPost(1l, 1l);%0A        mGetPostUsecase.buildUseCaseObservable();%0A%0A        verify(mMockListRepository).getPost(1l, 1l);%0A%0A        verifyNoMoreInteractions(mMockListRepository);%0A        verifyNoMoreInteractions(mMockPostExecutionThread);%0A        verifyNoMoreInteractions(mMockThreadExecutor);%0A    %7D%0A%0A    @Test%0A    public void shouldThrowRuntimeException() %7B%0A        assertThat(mGetPostUsecase).isNotNull();%0A        mGetPostUsecase.setGetPost(null, null);%0A        try %7B%0A            mGetPostUsecase.execute(null);%0A            assert_().fail(%22Should have thrown RuntimeException%22);%0A        %7D catch (RuntimeException e) %7B%0A            assertThat(e).hasMessage(%0A                    %22Deployment id or postId cannot be null. You must call setGetPost(...)%22);%0A        %7D%0A    %7D%0A%7D%0A

Add test for get post use case