// Path: src/test/java/com/uwetrottmann/tmdb2/BaseTestCase.java
// public abstract class BaseTestCase {
// 
//     private static final boolean LOG_BODY = System.getenv("CI") == null;
// 
//     // Do NOT use this API key in your application, it is only for testing tmdb-java!
//     private static final String TEST_API_KEY = "25da90e9f8f0b3892d8bdeb6c3d6267d";
//     // limit requests for tests to avoid hitting TMDb rate limit (40 requests/10 seconds)
//     @SuppressWarnings("UnstableApiUsage") private static final RateLimiter rateLimiter = RateLimiter.create(5);
// 
//     private static final Tmdb unauthenticatedInstance = new BaseTestCase.TestTmdb(TEST_API_KEY);
//     private static final Tmdb authenticatedInstance  = new BaseTestCase.TestTmdb(TEST_API_KEY);
// 
//     protected static Tmdb getUnauthenticatedInstance() {
//         return unauthenticatedInstance;
//     }
// 
//     protected static Tmdb getAuthenticatedInstance() {
//         return authenticatedInstance;
//     }
// 
//     private static class TestTmdb extends Tmdb {
//         public TestTmdb(String apiKey) {
//             super(apiKey);
//         }
// 
//         @Override
//         protected void setOkHttpClientDefaults(OkHttpClient.Builder builder) {
//             final Tmdb instance = this;
//             builder.authenticator(new TmdbAuthenticator(instance));
//             builder.addInterceptor(chain -> {
//                 rateLimiter.acquire();
//                 return TmdbInterceptor.handleIntercept(chain, instance);
//             });
//             // add logging, standard output is easier to read
//             // but only log headers on CI to keep logs short
//             HttpLoggingInterceptor logging = new HttpLoggingInterceptor(System.out::println);
//             logging.setLevel(LOG_BODY ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.BASIC);
//             builder.addNetworkInterceptor(logging);
//         }
//     }
// 
// }
// 
// Path: src/main/java/com/uwetrottmann/tmdb2/entities/Network.java
// public class Network {
//     public Integer id;
//     public String name;
// 
//     public String homepage;
//     public String headquarters;
//     public String logo_path;
//     public String origin_country;
// }
// 
// Path: src/main/java/com/uwetrottmann/tmdb2/entities/NetworkImages.java
// public class NetworkImages {
//     public List<NetworkImage> logos;
// }
// 
// Path: src/test/java/com/uwetrottmann/tmdb2/TestData.java
// public static final Network testNetwork = new Network();
// 
// Path: src/test/java/com/uwetrottmann/tmdb2/assertions/GenericAssertions.java
// public static void assertNetworkImages(List<NetworkImage> images) {
//     assertThat(images).isNotNull();
//     assertThat(images).isNotEmpty();
//     for (NetworkImage image : images) {
//         assertNetworkImage(image);
//     }
// }
// 
// Path: src/test/java/com/uwetrottmann/tmdb2/assertions/NetworkAssertions.java
// public static void assertNetworkDataIntegrity(Network network) {
//     assertNetwork(network, false);
//     assertThat(network.name).isEqualTo(testNetwork.name);
//     assertThat(network.id).isEqualTo(testNetwork.id);
// }


import com.uwetrottmann.tmdb2.BaseTestCase;
import com.uwetrottmann.tmdb2.entities.Network;
import com.uwetrottmann.tmdb2.entities.NetworkImages;
import org.junit.Test;
import retrofit2.Call;
import java.io.IOException;
import static com.uwetrottmann.tmdb2.TestData.testNetwork;
import static com.uwetrottmann.tmdb2.assertions.GenericAssertions.assertNetworkImages;
import static com.uwetrottmann.tmdb2.assertions.NetworkAssertions.assertNetworkDataIntegrity;
package com.uwetrottmann.tmdb2.services;




public class NetworksServiceTest extends BaseTestCase {
    @Test
    public void test_networks() throws IOException {
        Call<Network> call = getUnauthenticatedInstance().networksService().summary(
                testNetwork.id
        );

        Network network = call.execute().body();

        assertNetworkDataIntegrity(network);
    }

    @Test
    public void test_network_images() throws IOException {
        Call<NetworkImages> call = getUnauthenticatedInstance().networksService().images(
// Path: src/test/java/com/uwetrottmann/tmdb2/BaseTestCase.java
// public abstract class BaseTestCase {
// 
//     private static final boolean LOG_BODY = System.getenv("CI") == null;
// 
//     // Do NOT use this API key in your application, it is only for testing tmdb-java!
//     private static final String TEST_API_KEY = "25da90e9f8f0b3892d8bdeb6c3d6267d";
//     // limit requests for tests to avoid hitting TMDb rate limit (40 requests/10 seconds)
//     @SuppressWarnings("UnstableApiUsage") private static final RateLimiter rateLimiter = RateLimiter.create(5);
// 
//     private static final Tmdb unauthenticatedInstance = new BaseTestCase.TestTmdb(TEST_API_KEY);
//     private static final Tmdb authenticatedInstance  = new BaseTestCase.TestTmdb(TEST_API_KEY);
// 
//     protected static Tmdb getUnauthenticatedInstance() {
//         return unauthenticatedInstance;
//     }
// 
//     protected static Tmdb getAuthenticatedInstance() {
//         return authenticatedInstance;
//     }
// 
//     private static class TestTmdb extends Tmdb {
//         public TestTmdb(String apiKey) {
//             super(apiKey);
//         }
// 
//         @Override
//         protected void setOkHttpClientDefaults(OkHttpClient.Builder builder) {
//             final Tmdb instance = this;
//             builder.authenticator(new TmdbAuthenticator(instance));
//             builder.addInterceptor(chain -> {
//                 rateLimiter.acquire();
//                 return TmdbInterceptor.handleIntercept(chain, instance);
//             });
//             // add logging, standard output is easier to read
//             // but only log headers on CI to keep logs short
//             HttpLoggingInterceptor logging = new HttpLoggingInterceptor(System.out::println);
//             logging.setLevel(LOG_BODY ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.BASIC);
//             builder.addNetworkInterceptor(logging);
//         }
//     }
// 
// }
// 
// Path: src/main/java/com/uwetrottmann/tmdb2/entities/Network.java
// public class Network {
//     public Integer id;
//     public String name;
// 
//     public String homepage;
//     public String headquarters;
//     public String logo_path;
//     public String origin_country;
// }
// 
// Path: src/main/java/com/uwetrottmann/tmdb2/entities/NetworkImages.java
// public class NetworkImages {
//     public List<NetworkImage> logos;
// }
// 
// Path: src/test/java/com/uwetrottmann/tmdb2/TestData.java
// public static final Network testNetwork = new Network();
// 
// Path: src/test/java/com/uwetrottmann/tmdb2/assertions/GenericAssertions.java
// public static void assertNetworkImages(List<NetworkImage> images) {
//     assertThat(images).isNotNull();
//     assertThat(images).isNotEmpty();
//     for (NetworkImage image : images) {
//         assertNetworkImage(image);
//     }
// }
// 
// Path: src/test/java/com/uwetrottmann/tmdb2/assertions/NetworkAssertions.java
// public static void assertNetworkDataIntegrity(Network network) {
//     assertNetwork(network, false);
//     assertThat(network.name).isEqualTo(testNetwork.name);
//     assertThat(network.id).isEqualTo(testNetwork.id);
// }


// Path: src/test/java/com/uwetrottmann/tmdb2/services/NetworksServiceTest.java
import com.uwetrottmann.tmdb2.BaseTestCase;
import com.uwetrottmann.tmdb2.entities.Network;
import com.uwetrottmann.tmdb2.entities.NetworkImages;
import org.junit.Test;
import retrofit2.Call;
import java.io.IOException;
import static com.uwetrottmann.tmdb2.TestData.testNetwork;
import static com.uwetrottmann.tmdb2.assertions.GenericAssertions.assertNetworkImages;
import static com.uwetrottmann.tmdb2.assertions.NetworkAssertions.assertNetworkDataIntegrity;

package com.uwetrottmann.tmdb2.services;




public class NetworksServiceTest extends BaseTestCase {
    @Test
    public void test_networks() throws IOException {
        Call<Network> call = getUnauthenticatedInstance().networksService().summary(
                testNetwork.id
        );

        Network network = call.execute().body();

        assertNetworkDataIntegrity(network);
    }

    @Test
    public void test_network_images() throws IOException {
        Call<NetworkImages> call = getUnauthenticatedInstance().networksService().images(
                testNetwork.id