// Path: src/main/java/com/google/dicomwebfuse/dao/Constants.java
// public static final Integer MAX_SERIES_IN_STUDY = VALUE_PARAM_MAX_LIMIT_FOR_SERIES * 3;
// 
// Path: src/main/java/com/google/dicomwebfuse/dao/Constants.java
// public static final Integer MAX_STUDIES_IN_DICOM_STORE = VALUE_PARAM_MAX_LIMIT_FOR_STUDY * 3;
// 
// Path: src/main/java/com/google/dicomwebfuse/dao/Constants.java
// public static final Integer VALUE_PARAM_MAX_LIMIT_FOR_INSTANCES = 15000; // max - 50 000 results
// 
// Path: src/main/java/com/google/dicomwebfuse/dao/Constants.java
// public static final Integer VALUE_PARAM_MAX_LIMIT_FOR_SERIES = 5000;
// 
// Path: src/main/java/com/google/dicomwebfuse/dao/Constants.java
// public static final Integer VALUE_PARAM_MAX_LIMIT_FOR_STUDY = 5000;
// 
// Path: src/main/java/com/google/dicomwebfuse/auth/AuthAdc.java
// public class AuthAdc {
// 
//   private static final List<String> SCOPES = Collections.singletonList(
//       "https://www.googleapis.com/auth/cloud-healthcare"
//   );
//   private GoogleCredentials googleCredentials;
// 
//   public AuthAdc(GoogleCredentials googleCredentials) {
//     this.googleCredentials = googleCredentials;
//   }
// 
//   public AuthAdc() {
//   }
// 
//   public void createCredentials(Path keyPath) throws IOException {
//     InputStream inputStream = new FileInputStream(keyPath.toFile());
//     googleCredentials = GoogleCredentials.fromStream(inputStream).createScoped(SCOPES);
//   }
// 
//   public void createCredentials() throws IOException {
//     googleCredentials = GoogleCredentials.getApplicationDefault().createScoped(SCOPES);
//   }
// 
//   public GoogleCredentials getCredentials() throws IOException {
//     googleCredentials.getRequestMetadata(); // Update token if it necessary.
//     return googleCredentials;
//   }
// }
// 
// Path: src/main/java/com/google/dicomwebfuse/dao/http/HttpClientFactory.java
// public interface HttpClientFactory {
// 
//   CloseableHttpClient createHttpClient();
// }
// 
// Path: src/main/java/com/google/dicomwebfuse/exception/DicomFuseException.java
// public class DicomFuseException extends Exception {
// 
//   private int statusCode;
// 
//   public DicomFuseException(String message) {
//     super(message);
//   }
// 
//   public DicomFuseException(String message, Exception e) {
//     super(message, e);
//   }
// 
//   public DicomFuseException(Exception e) {
//     super(e);
//   }
// 
//   public DicomFuseException(String message, int statusCode) {
//     super(message);
//     this.statusCode = statusCode;
//   }
// 
//   public int getStatusCode() {
//     return statusCode;
//   }
// }


import static com.google.dicomwebfuse.EntityType.DICOM_STORE;
import static com.google.dicomwebfuse.dao.Constants.MAX_INSTANCES_IN_SERIES;
import static com.google.dicomwebfuse.dao.Constants.MAX_SERIES_IN_STUDY;
import static com.google.dicomwebfuse.dao.Constants.MAX_STUDIES_IN_DICOM_STORE;
import static com.google.dicomwebfuse.dao.Constants.VALUE_PARAM_MAX_LIMIT_FOR_INSTANCES;
import static com.google.dicomwebfuse.dao.Constants.VALUE_PARAM_MAX_LIMIT_FOR_SERIES;
import static com.google.dicomwebfuse.dao.Constants.VALUE_PARAM_MAX_LIMIT_FOR_STUDY;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.auth.oauth2.AccessToken;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.dicomwebfuse.auth.AuthAdc;
import com.google.dicomwebfuse.dao.http.HttpClientFactory;
import com.google.dicomwebfuse.exception.DicomFuseException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.apache.http.ProtocolVersion;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.entity.BasicHttpEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.message.BasicStatusLine;
import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;
// Copyright 2019 Google LLC
//
// Licensed 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.

package com.google.dicomwebfuse;



/**
 * Util class with helper methods for unit tests.
 */
public class TestUtils {

  /**
   * Generates mocked HttpClientFactory.
   *
   * @param closeableHttpClient mocked CloseableHttpClient
   * @return generated HttpClientFactory
   */
  public static HttpClientFactory prepareHttpClientFactory(
      CloseableHttpClient closeableHttpClient) {
// Path: src/main/java/com/google/dicomwebfuse/dao/Constants.java
// public static final Integer MAX_SERIES_IN_STUDY = VALUE_PARAM_MAX_LIMIT_FOR_SERIES * 3;
// 
// Path: src/main/java/com/google/dicomwebfuse/dao/Constants.java
// public static final Integer MAX_STUDIES_IN_DICOM_STORE = VALUE_PARAM_MAX_LIMIT_FOR_STUDY * 3;
// 
// Path: src/main/java/com/google/dicomwebfuse/dao/Constants.java
// public static final Integer VALUE_PARAM_MAX_LIMIT_FOR_INSTANCES = 15000; // max - 50 000 results
// 
// Path: src/main/java/com/google/dicomwebfuse/dao/Constants.java
// public static final Integer VALUE_PARAM_MAX_LIMIT_FOR_SERIES = 5000;
// 
// Path: src/main/java/com/google/dicomwebfuse/dao/Constants.java
// public static final Integer VALUE_PARAM_MAX_LIMIT_FOR_STUDY = 5000;
// 
// Path: src/main/java/com/google/dicomwebfuse/auth/AuthAdc.java
// public class AuthAdc {
// 
//   private static final List<String> SCOPES = Collections.singletonList(
//       "https://www.googleapis.com/auth/cloud-healthcare"
//   );
//   private GoogleCredentials googleCredentials;
// 
//   public AuthAdc(GoogleCredentials googleCredentials) {
//     this.googleCredentials = googleCredentials;
//   }
// 
//   public AuthAdc() {
//   }
// 
//   public void createCredentials(Path keyPath) throws IOException {
//     InputStream inputStream = new FileInputStream(keyPath.toFile());
//     googleCredentials = GoogleCredentials.fromStream(inputStream).createScoped(SCOPES);
//   }
// 
//   public void createCredentials() throws IOException {
//     googleCredentials = GoogleCredentials.getApplicationDefault().createScoped(SCOPES);
//   }
// 
//   public GoogleCredentials getCredentials() throws IOException {
//     googleCredentials.getRequestMetadata(); // Update token if it necessary.
//     return googleCredentials;
//   }
// }
// 
// Path: src/main/java/com/google/dicomwebfuse/dao/http/HttpClientFactory.java
// public interface HttpClientFactory {
// 
//   CloseableHttpClient createHttpClient();
// }
// 
// Path: src/main/java/com/google/dicomwebfuse/exception/DicomFuseException.java
// public class DicomFuseException extends Exception {
// 
//   private int statusCode;
// 
//   public DicomFuseException(String message) {
//     super(message);
//   }
// 
//   public DicomFuseException(String message, Exception e) {
//     super(message, e);
//   }
// 
//   public DicomFuseException(Exception e) {
//     super(e);
//   }
// 
//   public DicomFuseException(String message, int statusCode) {
//     super(message);
//     this.statusCode = statusCode;
//   }
// 
//   public int getStatusCode() {
//     return statusCode;
//   }
// }


// Path: src/test/java/com/google/dicomwebfuse/TestUtils.java
import static com.google.dicomwebfuse.EntityType.DICOM_STORE;
import static com.google.dicomwebfuse.dao.Constants.MAX_INSTANCES_IN_SERIES;
import static com.google.dicomwebfuse.dao.Constants.MAX_SERIES_IN_STUDY;
import static com.google.dicomwebfuse.dao.Constants.MAX_STUDIES_IN_DICOM_STORE;
import static com.google.dicomwebfuse.dao.Constants.VALUE_PARAM_MAX_LIMIT_FOR_INSTANCES;
import static com.google.dicomwebfuse.dao.Constants.VALUE_PARAM_MAX_LIMIT_FOR_SERIES;
import static com.google.dicomwebfuse.dao.Constants.VALUE_PARAM_MAX_LIMIT_FOR_STUDY;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.auth.oauth2.AccessToken;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.dicomwebfuse.auth.AuthAdc;
import com.google.dicomwebfuse.dao.http.HttpClientFactory;
import com.google.dicomwebfuse.exception.DicomFuseException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.apache.http.ProtocolVersion;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.entity.BasicHttpEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.message.BasicStatusLine;
import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;

// Copyright 2019 Google LLC
//
// Licensed 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.

package com.google.dicomwebfuse;



/**
 * Util class with helper methods for unit tests.
 */
public class TestUtils {

  /**
   * Generates mocked HttpClientFactory.
   *
   * @param closeableHttpClient mocked CloseableHttpClient
   * @return generated HttpClientFactory
   */
  public static HttpClientFactory prepareHttpClientFactory(
      CloseableHttpClient closeableHttpClient) {
    HttpClientFactory httpClientFactory = Mockito.mock(HttpClientFactory.class);