<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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.kie.server</groupId>
    <artifactId>kie-server-tests</artifactId>
    <version>7.52.0.Final</version>
  </parent>

  <artifactId>kie-server-integ-tests-task-assigning</artifactId>

  <name>KIE :: Execution Server :: Tests :: Task Assigning Integration Tests</name>
  <description>KIE Execution Server Integration Tests with configuration options to run on different containers.</description>

  <properties>
    <java.module.name>org.kie.server.itests.taskassigning</java.module.name>
  </properties>

  <dependencies>
    <!-- Common Kie server test classes -->
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-integ-tests-common</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- kie server deps -->
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-client</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Deployments for application servers -->
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server</artifactId>
      <classifier>webc</classifier>
      <type>war</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server</artifactId>
      <classifier>ee7</classifier>
      <type>war</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server</artifactId>
      <classifier>ee8</classifier>
      <type>war</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <configuration>
            <systemPropertyVariables>
              <!-- Values are supplied by specific profiles -->
              <org.kie.server.bypass.auth.user>true</org.kie.server.bypass.auth.user>
              <cargo.container.id>${cargo.container.id}</cargo.container.id>
              <cargo.servlet.port>${container.port}</cargo.servlet.port>
              <kie.server.context>${kie.server.context}</kie.server.context>
              <kie.server.war.path>${kie.server.war.path}</kie.server.war.path>
              <kie.server.remoting.url>${kie.server.remoting.url}</kie.server.remoting.url>
              <kie.server.base.http.url>${kie.server.base.http.url}</kie.server.base.http.url>
              <kie.server.testing.kjars.build.settings.xml>${kie.server.testing.kjars.build.settings.xml}</kie.server.testing.kjars.build.settings.xml>
            </systemPropertyVariables>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>false</filtering>
      </testResource>
      <testResource>
        <directory>src/test/filtered-resources</directory>
        <filtering>true</filtering>
      </testResource>
      <testResource>
        <directory>../src/test/filtered-resources</directory>
        <excludes>
          <exclude>application.properties</exclude>
        </excludes>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <configuration>
          <container>
            <systemProperties>
              <org.kie.server.taskAssigning.runtime.ext.disabled>false</org.kie.server.taskAssigning.runtime.ext.disabled>
              <org.kie.server.taskAssigning.planning.ext.disabled>false</org.kie.server.taskAssigning.planning.ext.disabled>
              <org.jbpm.server.ext.disabled>false</org.jbpm.server.ext.disabled>
              <org.jbpm.ui.server.ext.disabled>true</org.jbpm.ui.server.ext.disabled>
              <org.optaplanner.server.ext.disabled>true</org.optaplanner.server.ext.disabled>
              <org.jbpm.case.server.ext.disabled>true</org.jbpm.case.server.ext.disabled>
              <org.drools.server.ext.disabled>true</org.drools.server.ext.disabled>

              <org.kie.server.bypass.auth.user>true</org.kie.server.bypass.auth.user>
              <org.jbpm.ht.admin.group>process-admin</org.jbpm.ht.admin.group>

              <org.kie.server.taskAssigning.publishWindowSize>2</org.kie.server.taskAssigning.publishWindowSize>
              <org.kie.server.taskAssigning.processRuntime.url>http://${container.hostname}:${container.port}/kie-server-services/services/rest/server</org.kie.server.taskAssigning.processRuntime.url>
              <org.kie.server.taskAssigning.processRuntime.user>yoda</org.kie.server.taskAssigning.processRuntime.user>
              <org.kie.server.taskAssigning.processRuntime.pwd>usetheforce123@</org.kie.server.taskAssigning.processRuntime.pwd>
              <org.kie.server.taskAssigning.processRuntime.targetUser>yoda</org.kie.server.taskAssigning.processRuntime.targetUser>>
              <org.kie.server.taskAssigning.solutionSyncInterval>PT1S</org.kie.server.taskAssigning.solutionSyncInterval>

              <org.kie.server.taskAssigning.userSystem.name>SimpleUserSystemService</org.kie.server.taskAssigning.userSystem.name>
              <org.kie.server.services.taskassigning.user.system.simple.users>${project.build.testOutputDirectory}/roles.properties</org.kie.server.services.taskassigning.user.system.simple.users>
              <org.kie.server.services.taskassigning.user.system.simple.skills>${project.build.testOutputDirectory}/skills.properties</org.kie.server.services.taskassigning.user.system.simple.skills>
              <org.kie.server.services.taskassigning.core.model.planningUserId>yoda</org.kie.server.services.taskassigning.core.model.planningUserId>
            </systemProperties>
          </container>
          <configuration>
            <users>
              <user>
                <name>yoda</name>
                <password>usetheforce123@</password>
                <roles>
                  <role>kie-server</role>
                  <role>guest</role>
                  <role>process-admin</role>
                </roles>
              </user>
              <user>
                <name>john</name>
                <password>john123*</password>
                <roles>
                  <role>kie-server</role>
                  <role>user</role>
                  <role>ClientRelations</role>
                </roles>
              </user>
              <user>
                <name>mary</name>
                <password>mary123*</password>
                <roles>
                  <role>kie-server</role>
                  <role>user</role>
                  <role>ClientRelations</role>
                </roles>
              </user>
              <user>
                <name>katy</name>
                <password>katy123*</password>
                <roles>
                  <role>kie-server</role>
                  <role>user</role>
                  <role>CreditAnalyst</role>
                </roles>
              </user>
              <user>
                <name>maciek</name>
                <password>maciek123*</password>
                <roles>
                  <role>kie-server</role>
                  <role>user</role>
                  <role>CreditAnalyst</role>
                </roles>
              </user>
            </users>
          </configuration>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>tomcat9</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>tomcat9</value>
        </property>
      </activation>
    </profile>
    <profile>
      <id>wildfly</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>wildfly</value>
        </property>
      </activation>
    </profile>
    <profile>
      <id>eap7</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>eap7</value>
        </property>
      </activation>
    </profile>
    <profile>
      <id>oracle-wls-12</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>oracle-wls-12</value>
        </property>
      </activation>
    </profile>
    <profile>
      <id>websphere9</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>websphere9</value>
        </property>
      </activation>
    </profile>
    <profile>
      <id>springboot</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>springboot</value>
        </property>
      </activation>
      <properties>
        <kieserver.jbpm.enabled>true</kieserver.jbpm.enabled>
        <kieserver.jbpmui.enabled>false</kieserver.jbpmui.enabled>
        <kieserver.optaplanner.enabled>false</kieserver.optaplanner.enabled>
        <kieserver.casemgmt.enabled>false</kieserver.casemgmt.enabled>
        <kieserver.drools.enabled>false</kieserver.drools.enabled>

        <org.kie.server.bypass.auth.user>true</org.kie.server.bypass.auth.user>
        <kieserver.taskAssigning.runtime.enabled>true</kieserver.taskAssigning.runtime.enabled>
        <kieserver.taskAssigning.planning.enabled>true</kieserver.taskAssigning.planning.enabled>

        <taskassigning.processRuntime.url>http://${container.hostname}:${container.port}/kie-server-services/services/rest/server</taskassigning.processRuntime.url>
        <taskassigning.processRuntime.user>administrator</taskassigning.processRuntime.user>
        <taskassigning.processRuntime.pwd>usetheforce123@</taskassigning.processRuntime.pwd>
        <taskassigning.processRuntime.targetUser>administrator</taskassigning.processRuntime.targetUser>
        <taskassigning.core.model.planningUserId>administrator</taskassigning.core.model.planningUserId>
        <taskassigning.publishWindowSize>2</taskassigning.publishWindowSize>
        <taskassigning.solutionSyncInterval>PT1S</taskassigning.solutionSyncInterval>

        <taskassigning.userSystem.name>SimpleUserSystemService</taskassigning.userSystem.name>
        <taskassigning.userSystem.simple.users>${project.build.testOutputDirectory}/roles.properties</taskassigning.userSystem.simple.users>
        <taskassigning.userSystem.simple.skills>${project.build.testOutputDirectory}/skills.properties</taskassigning.userSystem.simple.skills>
      </properties>
    </profile>
  </profiles>
</project>