<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2015 Red Hat, Inc.

    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.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <artifactId>kubernetes-client-project</artifactId>
    <groupId>io.fabric8</groupId>
    <version>4.4.1</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>kubernetes-test</artifactId>
  <name>Fabric8 :: Kubernetes :: Tests</name>
  <packaging>jar</packaging>

  <dependencies>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-client</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>openshift-client</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-server-mock</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>openshift-server-mock</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>mockwebserver</artifactId>
      <version>${mockwebserver.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
        </exclusion>
      </exclusions>
    </dependency>


    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <version>${log4j.version}</version>
      <scope>test</scope>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>${log4j.version}</version>
      <optional>true</optional>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.core.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-ext-jdk15on</artifactId>
      <version>${bouncycastle.version}</version>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-jdk15on</artifactId>
      <version>${bouncycastle.version}</version>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven.surefire.plugin.version}</version>
        <configuration>
          <forkCount>1</forkCount>
          <reuseForks>false</reuseForks>
          <!-- We cleanup system properties an env vars, so that we can test in a predictable env -->
          <environmentVariables>
            <KUBERNETES_MASTER />
            <KUBERNETES_API_VERSION />
            <KUBERNETES_TRUST_CERTIFICATES />
            <KUBERNETES_CERTS_CA_FILE />
            <KUBERNETES_CERTS_CA_DATA />
            <KUBERNETES_CERTS_CLIENT_FILE />
            <KUBERNETES_CERTS_CLIENT_DATA />
            <KUBERNETES_CERTS_CLIENT_KEY_FILE />
            <KUBERNETES_CERTS_CLIENT_KEY_DATA />
            <KUBERNETES_CERTS_CLIENT_KEY_ALGO />
            <KUBERNETES_CERTS_CLIENT_KEY_PASSPHRASE />
            <KUBERNETES_AUTH_BASIC_USERNAME />
            <KUBERNETES_AUTH_BASIC_PASSWORD />
            <KUBERNETES_AUTH_TRYKUBECONFIG />
            <KUBERNETES_AUTH_TRYSERVICEACCOUNT />
            <KUBERNETES_AUTH_TOKEN />
            <KUBERNETES_WATCH_RECONNECTINTERVAL />
            <KUBERNETES_WATCH_RECONNECTLIMIT />
            <KUBERNETES_REQUEST_TIMEOUT />
            <KUBERNETES_NAMESPACE />
            <KUBERNETES_TLS_VERSIONS>TLSv1.2,TLSv1.1,TLSv1</KUBERNETES_TLS_VERSIONS>
          </environmentVariables>
        </configuration>
      </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.6.0</version>
          <executions>
            <execution>
              <goals>
                <goal>java</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <classpathScope>test</classpathScope>
          </configuration>
        </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>**/WatchTest.*</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
