// Path: app/src/test/java/com/txusballesteros/testing/UnitTest.java
// @RunWith(JUnit4.class)
// @SmallTest
// public abstract class UnitTest {
//     @Before
//     public final void setup() {
//         initializeMocks();
//         onSetup();
//     }
// 
//     private void initializeMocks() {
//         MockitoAnnotations.initMocks(this);
//     }
// 
//     protected abstract void onSetup();
// }
// 
// Path: app/src/main/java/com/txusballesteros/testing/data/api/DashboardApi.java
// public interface DashboardApi {
//     List<ImageResponse> getDashboard();
// }
// 
// Path: app/src/main/java/com/txusballesteros/testing/data/api/model/ImageResponse.java
// public class ImageResponse {
//     private Uri url;
// 
//     private ImageResponse() { }
// 
//     public Uri getUrl() {
//         return url;
//     }
// 
//     public static class Builder {
//         private ImageResponse image;
// 
//         public Builder() {
//             this.image = new ImageResponse();
//         }
// 
//         public Builder setUrl(Uri url) {
//             image.url = url;
//             return this;
//         }
// 
//         public ImageResponse build() {
//             return image;
//         }
//     }
// }
// 
// Path: app/src/main/java/com/txusballesteros/testing/data/api/model/ImageResponseMapper.java
// public interface ImageResponseMapper {
//     List<ImageResponse> map(DashboardListEndpointResponse source);
//     List<ImageEntity> map(List<ImageResponse> source);
//     ImageEntity map(ImageResponse source);
//     ImageResponse map(DashboardEndpointResponse source);
// }


import org.mockito.Mock;
import java.util.List;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
import com.txusballesteros.testing.UnitTest;
import com.txusballesteros.testing.data.api.DashboardApi;
import com.txusballesteros.testing.data.api.model.ImageResponse;
import com.txusballesteros.testing.data.api.model.ImageResponseMapper;
import org.junit.Test;
/*
 * Copyright Txus Ballesteros 2016 (@txusballesteros)
 *
 * This file is part of some open source application.
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
 * Contact: Txus Ballesteros <txus.ballesteros@gmail.com>
 */
package com.txusballesteros.testing.data.datasource;





public class DashboardCloudDatasourceUnitTest extends UnitTest {
    @Mock DashboardApi dashboardApiMock;
    @Mock ImageResponseMapper imageResponseMapperMock;
    @Mock List<ImageResponse> apiRessultMock;
    private DashboardDatasource datasource;

    @Override
    protected void onSetup() {
        datasource = new DashboardCloudDatasource(dashboardApiMock, imageResponseMapperMock);
    }

    @Test
    public void shouldGetDashboard() {
        doReturn(apiRessultMock).when(dashboardApiMock).getDashboard();

        datasource.getDashboard();

// Path: app/src/test/java/com/txusballesteros/testing/UnitTest.java
// @RunWith(JUnit4.class)
// @SmallTest
// public abstract class UnitTest {
//     @Before
//     public final void setup() {
//         initializeMocks();
//         onSetup();
//     }
// 
//     private void initializeMocks() {
//         MockitoAnnotations.initMocks(this);
//     }
// 
//     protected abstract void onSetup();
// }
// 
// Path: app/src/main/java/com/txusballesteros/testing/data/api/DashboardApi.java
// public interface DashboardApi {
//     List<ImageResponse> getDashboard();
// }
// 
// Path: app/src/main/java/com/txusballesteros/testing/data/api/model/ImageResponse.java
// public class ImageResponse {
//     private Uri url;
// 
//     private ImageResponse() { }
// 
//     public Uri getUrl() {
//         return url;
//     }
// 
//     public static class Builder {
//         private ImageResponse image;
// 
//         public Builder() {
//             this.image = new ImageResponse();
//         }
// 
//         public Builder setUrl(Uri url) {
//             image.url = url;
//             return this;
//         }
// 
//         public ImageResponse build() {
//             return image;
//         }
//     }
// }
// 
// Path: app/src/main/java/com/txusballesteros/testing/data/api/model/ImageResponseMapper.java
// public interface ImageResponseMapper {
//     List<ImageResponse> map(DashboardListEndpointResponse source);
//     List<ImageEntity> map(List<ImageResponse> source);
//     ImageEntity map(ImageResponse source);
//     ImageResponse map(DashboardEndpointResponse source);
// }


// Path: app/src/test/java/com/txusballesteros/testing/data/datasource/DashboardCloudDatasourceUnitTest.java
import org.mockito.Mock;
import java.util.List;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
import com.txusballesteros.testing.UnitTest;
import com.txusballesteros.testing.data.api.DashboardApi;
import com.txusballesteros.testing.data.api.model.ImageResponse;
import com.txusballesteros.testing.data.api.model.ImageResponseMapper;
import org.junit.Test;

/*
 * Copyright Txus Ballesteros 2016 (@txusballesteros)
 *
 * This file is part of some open source application.
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
 * Contact: Txus Ballesteros <txus.ballesteros@gmail.com>
 */
package com.txusballesteros.testing.data.datasource;





public class DashboardCloudDatasourceUnitTest extends UnitTest {
    @Mock DashboardApi dashboardApiMock;
    @Mock ImageResponseMapper imageResponseMapperMock;
    @Mock List<ImageResponse> apiRessultMock;
    private DashboardDatasource datasource;

    @Override
    protected void onSetup() {
        datasource = new DashboardCloudDatasource(dashboardApiMock, imageResponseMapperMock);
    }

    @Test
    public void shouldGetDashboard() {
        doReturn(apiRessultMock).when(dashboardApiMock).getDashboard();

        datasource.getDashboard();

        verify(dashboardApiMock).getDashboard();