TSK-925: refactored taskana-simplehistory-provider
This commit is contained in:
parent
cd556d87f4
commit
d0f06a63c4
225
history/pom.xml
225
history/pom.xml
|
@ -3,11 +3,10 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>pro.taskana.simplehistory</groupId>
|
<groupId>pro.taskana.simplehistory</groupId>
|
||||||
<artifactId>taskana-simplehistory-parent</artifactId>
|
<artifactId>taskana-simplehistory-parent</artifactId>
|
||||||
<version>1.1.5-SNAPSHOT</version>
|
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>${project.groupId}:${project.artifactId}</name>
|
<name>${project.groupId}:${project.artifactId}</name>
|
||||||
<description>The taskana history events plugin parent and bom module.</description>
|
<description>The taskana history events plugin parent and bom module.</description>
|
||||||
<url>http://taskana.pro</url>
|
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
|
@ -23,226 +22,4 @@
|
||||||
<module>taskana-simplehistory-rest-spring-example</module>
|
<module>taskana-simplehistory-rest-spring-example</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
|
||||||
|
|
||||||
<java.version>1.8</java.version>
|
|
||||||
|
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
|
||||||
|
|
||||||
<spring.version>5.0.5.RELEASE</spring.version>
|
|
||||||
<spring.boot.version>2.0.2.RELEASE</spring.boot.version>
|
|
||||||
|
|
||||||
<version.h2>1.4.197</version.h2>
|
|
||||||
<version.junit>4.12</version.junit>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<developers>
|
|
||||||
<developer>
|
|
||||||
<name>Holger Hagen</name>
|
|
||||||
<email>holger.hagen@novatec-gmbh.de</email>
|
|
||||||
<organization>NovaTec Consulting GmbH</organization>
|
|
||||||
<organizationUrl>https://www.novatec-gmbh.de</organizationUrl>
|
|
||||||
</developer>
|
|
||||||
</developers>
|
|
||||||
|
|
||||||
<scm>
|
|
||||||
<url>http://github.com/taskana/TaskanaSimpleHistory/tree/master</url>
|
|
||||||
<connection>scm:git:git://github.com/taskana/TaskanaSimpleHistory.git</connection>
|
|
||||||
<developerConnection>scm:git:ssh://github.com:taskana/TaskanaSimpleHistory.git</developerConnection>
|
|
||||||
</scm>
|
|
||||||
|
|
||||||
<licenses>
|
|
||||||
<license>
|
|
||||||
<name>The Apache License, Version 2.0</name>
|
|
||||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
|
||||||
</license>
|
|
||||||
</licenses>
|
|
||||||
|
|
||||||
<profiles>
|
|
||||||
<profile>
|
|
||||||
<id>snapshot</id>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
|
||||||
<version>1.6</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>sign-artifacts</id>
|
|
||||||
<phase>verify</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>sign</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.sonatype.plugins</groupId>
|
|
||||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
|
||||||
<version>1.6.8</version>
|
|
||||||
<extensions>true</extensions>
|
|
||||||
<configuration>
|
|
||||||
<serverId>ossrh</serverId>
|
|
||||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
|
||||||
<autoReleaseAfterClose>false</autoReleaseAfterClose>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
<distributionManagement>
|
|
||||||
<snapshotRepository>
|
|
||||||
<id>ossrh</id>
|
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
|
||||||
</snapshotRepository>
|
|
||||||
</distributionManagement>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>release</id>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
|
||||||
<version>1.6</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>sign-artifacts</id>
|
|
||||||
<phase>verify</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>sign</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.sonatype.plugins</groupId>
|
|
||||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
|
||||||
<version>1.6.8</version>
|
|
||||||
<extensions>true</extensions>
|
|
||||||
<configuration>
|
|
||||||
<serverId>ossrh</serverId>
|
|
||||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
|
||||||
<autoReleaseAfterClose>false</autoReleaseAfterClose>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
<distributionManagement>
|
|
||||||
<repository>
|
|
||||||
<id>ossrh</id>
|
|
||||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
|
||||||
</repository>
|
|
||||||
</distributionManagement>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
<build>
|
|
||||||
<pluginManagement>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.eclipse.m2e</groupId>
|
|
||||||
<artifactId>lifecycle-mapping</artifactId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
<configuration>
|
|
||||||
<lifecycleMappingMetadata>
|
|
||||||
<pluginExecutions>
|
|
||||||
<pluginExecution>
|
|
||||||
<pluginExecutionFilter>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
|
||||||
<versionRange>[1.0.0,)</versionRange>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
</pluginExecutionFilter>
|
|
||||||
<action>
|
|
||||||
<ignore/>
|
|
||||||
</action>
|
|
||||||
</pluginExecution>
|
|
||||||
</pluginExecutions>
|
|
||||||
</lifecycleMappingMetadata>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
|
||||||
<version>2.17</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>validate</id>
|
|
||||||
<phase>validate</phase>
|
|
||||||
<configuration>
|
|
||||||
<configLocation>../qa/checkstyle/checkstyle.xml</configLocation>
|
|
||||||
<encoding>UTF-8</encoding>
|
|
||||||
<consoleOutput>true</consoleOutput>
|
|
||||||
<failsOnError>true</failsOnError>
|
|
||||||
<failOnViolation>true</failOnViolation>
|
|
||||||
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
|
||||||
</configuration>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.5.1</version>
|
|
||||||
<configuration>
|
|
||||||
<showWarnings>true</showWarnings>
|
|
||||||
<compilerArgs>
|
|
||||||
<arg>-Xlint:all</arg>
|
|
||||||
</compilerArgs>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<version>3.0.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-sources</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar-no-fork</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>3.0.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-javadocs</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
<!-- necessary so that the taskana-snapshots are fetched from sonatype-->
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>snapshots-repo</id>
|
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
|
||||||
<releases>
|
|
||||||
<enabled>false</enabled>
|
|
||||||
</releases>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</snapshots>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,223 +1,76 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>taskana-simplehistory-provider</artifactId>
|
<artifactId>taskana-simplehistory-provider</artifactId>
|
||||||
|
|
||||||
<name>${project.groupId}:${project.artifactId}</name>
|
<name>${project.groupId}:${project.artifactId}</name>
|
||||||
<description>The taskana history events plugin to include in your project.</description>
|
<description>The taskana history events plugin to include in your project.</description>
|
||||||
<url>http://taskana.pro</url>
|
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana.simplehistory</groupId>
|
<groupId>pro.taskana.simplehistory</groupId>
|
||||||
<artifactId>taskana-simplehistory-parent</artifactId>
|
<artifactId>taskana-simplehistory-parent</artifactId>
|
||||||
<version>1.1.5-SNAPSHOT</version>
|
<version>1.1.5-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<licenses>
|
|
||||||
<license>
|
|
||||||
<name>The Apache License, Version 2.0</name>
|
|
||||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
|
||||||
</license>
|
|
||||||
</licenses>
|
|
||||||
|
|
||||||
<developers>
|
<dependencies>
|
||||||
<developer>
|
<dependency>
|
||||||
<name>Holger Hagen</name>
|
<groupId>pro.taskana</groupId>
|
||||||
<email>holger.hagen@novatec-gmbh.de</email>
|
<artifactId>taskana-core</artifactId>
|
||||||
<organization>NovaTec Consulting GmbH</organization>
|
<version>${project.version}</version>
|
||||||
<organizationUrl>https://www.novatec-gmbh.de</organizationUrl>
|
</dependency>
|
||||||
</developer>
|
<dependency>
|
||||||
</developers>
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<version>${version.slf4j}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-slf4j-impl</artifactId>
|
||||||
|
<version>${version.log4j}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-core</artifactId>
|
||||||
|
<version>${version.log4j}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis</artifactId>
|
||||||
|
<version>${version.mybatis}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>${version.junit}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.powermock</groupId>
|
||||||
|
<artifactId>powermock-api-mockito2</artifactId>
|
||||||
|
<version>${version.powermock}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.powermock</groupId>
|
||||||
|
<artifactId>powermock-module-junit4</artifactId>
|
||||||
|
<version>${version.powermock}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mockito</groupId>
|
||||||
|
<artifactId>mockito-core</artifactId>
|
||||||
|
<version>${version.mockito}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<scm>
|
<dependency>
|
||||||
<connection>scm:git:git://github.com/taskana/TaskanaSimpleHistory.git</connection>
|
<groupId>com.h2database</groupId>
|
||||||
<developerConnection>scm:git:ssh://github.com:taskana/TaskanaSimpleHistory.git</developerConnection>
|
<artifactId>h2</artifactId>
|
||||||
<url>http://github.com/taskana/TaskanaSimpleHistory/tree/master</url>
|
<version>${version.h2}</version>
|
||||||
</scm>
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<profiles>
|
</dependencies>
|
||||||
<profile>
|
|
||||||
<id>snapshot</id>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
|
||||||
<version>1.6</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>sign-artifacts</id>
|
|
||||||
<phase>verify</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>sign</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.sonatype.plugins</groupId>
|
|
||||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
|
||||||
<version>1.6.8</version>
|
|
||||||
<extensions>true</extensions>
|
|
||||||
<configuration>
|
|
||||||
<serverId>ossrh</serverId>
|
|
||||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
|
||||||
<autoReleaseAfterClose>false</autoReleaseAfterClose>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
<distributionManagement>
|
|
||||||
<snapshotRepository>
|
|
||||||
<id>ossrh</id>
|
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
|
||||||
</snapshotRepository>
|
|
||||||
</distributionManagement>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>release</id>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
|
||||||
<version>1.6</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>sign-artifacts</id>
|
|
||||||
<phase>verify</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>sign</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.sonatype.plugins</groupId>
|
|
||||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
|
||||||
<version>1.6.8</version>
|
|
||||||
<extensions>true</extensions>
|
|
||||||
<configuration>
|
|
||||||
<serverId>ossrh</serverId>
|
|
||||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
|
||||||
<autoReleaseAfterClose>false</autoReleaseAfterClose>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
<distributionManagement>
|
|
||||||
<repository>
|
|
||||||
<id>ossrh</id>
|
|
||||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
|
||||||
</repository>
|
|
||||||
</distributionManagement>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.5.1</version>
|
|
||||||
<configuration>
|
|
||||||
<showWarnings>true</showWarnings>
|
|
||||||
<compilerArgs>
|
|
||||||
<arg>-Xlint:all</arg>
|
|
||||||
</compilerArgs>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<version>3.0.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-sources</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar-no-fork</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>3.0.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-javadocs</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>pro.taskana</groupId>
|
|
||||||
<artifactId>taskana-core</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
<version>1.7.22</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
|
||||||
<artifactId>log4j-slf4j-impl</artifactId>
|
|
||||||
<version>2.8.1</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
|
||||||
<artifactId>log4j-core</artifactId>
|
|
||||||
<version>2.8.1</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis</groupId>
|
|
||||||
<artifactId>mybatis</artifactId>
|
|
||||||
<version>3.4.6</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mockito</groupId>
|
|
||||||
<artifactId>mockito-core</artifactId>
|
|
||||||
<version>1.10.19</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>${version.junit}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.powermock</groupId>
|
|
||||||
<artifactId>powermock-api-mockito</artifactId>
|
|
||||||
<version>1.6.2</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.powermock</groupId>
|
|
||||||
<artifactId>powermock-module-junit4</artifactId>
|
|
||||||
<version>1.6.2</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.h2database</groupId>
|
|
||||||
<artifactId>h2</artifactId>
|
|
||||||
<version>${version.h2}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.runners.MockitoJUnitRunner;
|
import org.mockito.junit.MockitoJUnitRunner;
|
||||||
|
|
||||||
import pro.taskana.TimeInterval;
|
import pro.taskana.TimeInterval;
|
||||||
import pro.taskana.simplehistory.impl.mappings.HistoryQueryMapper;
|
import pro.taskana.simplehistory.impl.mappings.HistoryQueryMapper;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package pro.taskana.simplehistory.impl;
|
package pro.taskana.simplehistory.impl;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.mockito.Matchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.Mockito.doNothing;
|
import static org.mockito.Mockito.doNothing;
|
||||||
import static org.mockito.Mockito.doReturn;
|
import static org.mockito.Mockito.doReturn;
|
||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.times;
|
||||||
|
@ -58,68 +58,65 @@ public class SimpleHistoryServiceImplTest {
|
||||||
@Mock
|
@Mock
|
||||||
private SqlSessionManager sqlSessionManagerMock;
|
private SqlSessionManager sqlSessionManagerMock;
|
||||||
|
|
||||||
@Mock
|
|
||||||
private HistoryQueryImpl historyQueryMock;
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInitializeSimpleHistoryService() throws SQLException {
|
public void testInitializeSimpleHistoryService() throws SQLException {
|
||||||
|
doReturn(historyEventMapperMock).when(sqlSessionManagerMock).getMapper(HistoryEventMapper.class);
|
||||||
|
doReturn(historyQueryMapperMock).when(sqlSessionManagerMock).getMapper(HistoryQueryMapper.class);
|
||||||
|
doReturn(sqlSessionManagerMock).when(taskanaHistoryEngineMock).getSqlSession();
|
||||||
|
PowerMockito.mockStatic(TaskanaHistoryEngineImpl.class);
|
||||||
|
Mockito.when(TaskanaHistoryEngineImpl.createTaskanaEngine(taskanaEngineConfiguration))
|
||||||
|
.thenReturn(taskanaHistoryEngineMock);
|
||||||
|
cutSpy.initialize(taskanaEngineConfiguration);
|
||||||
|
|
||||||
doReturn(historyEventMapperMock).when(sqlSessionManagerMock).getMapper(HistoryEventMapper.class);
|
verify(sqlSessionManagerMock, times(2)).getMapper(any());
|
||||||
doReturn(historyQueryMapperMock).when(sqlSessionManagerMock).getMapper(HistoryQueryMapper.class);
|
verify(taskanaHistoryEngineMock, times(2)).getSqlSession();
|
||||||
doReturn(sqlSessionManagerMock).when(taskanaHistoryEngineMock).getSqlSession();
|
}
|
||||||
PowerMockito.mockStatic(TaskanaHistoryEngineImpl.class);
|
|
||||||
Mockito.when(TaskanaHistoryEngineImpl.createTaskanaEngine(taskanaEngineConfiguration)).thenReturn(taskanaHistoryEngineMock);
|
|
||||||
cutSpy.initialize(taskanaEngineConfiguration);
|
|
||||||
|
|
||||||
verify(sqlSessionManagerMock, times(2)).getMapper(any());
|
@Test
|
||||||
verify(taskanaHistoryEngineMock, times(2)).getSqlSession();
|
public void testInitializeSimpleHistoryServiceWithNonDefaultSchemaName() throws SQLException {
|
||||||
PowerMockito.verifyStatic();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
doReturn(historyEventMapperMock).when(sqlSessionManagerMock).getMapper(HistoryEventMapper.class);
|
||||||
public void testInitializeSimpleHistoryServiceWithNonDefaultSchemaName() throws SQLException {
|
doReturn(historyQueryMapperMock).when(sqlSessionManagerMock).getMapper(HistoryQueryMapper.class);
|
||||||
|
doReturn(sqlSessionManagerMock).when(taskanaHistoryEngineMock).getSqlSession();
|
||||||
|
PowerMockito.mockStatic(TaskanaHistoryEngineImpl.class);
|
||||||
|
Mockito.when(TaskanaHistoryEngineImpl.createTaskanaEngine(taskanaEngineConfiguration))
|
||||||
|
.thenReturn(taskanaHistoryEngineMock);
|
||||||
|
cutSpy.initialize(taskanaEngineConfiguration);
|
||||||
|
|
||||||
doReturn(historyEventMapperMock).when(sqlSessionManagerMock).getMapper(HistoryEventMapper.class);
|
verify(sqlSessionManagerMock, times(2)).getMapper(any());
|
||||||
doReturn(historyQueryMapperMock).when(sqlSessionManagerMock).getMapper(HistoryQueryMapper.class);
|
verify(taskanaHistoryEngineMock, times(2)).getSqlSession();
|
||||||
doReturn(sqlSessionManagerMock).when(taskanaHistoryEngineMock).getSqlSession();
|
}
|
||||||
PowerMockito.mockStatic(TaskanaHistoryEngineImpl.class);
|
|
||||||
Mockito.when(TaskanaHistoryEngineImpl.createTaskanaEngine(taskanaEngineConfiguration)).thenReturn(taskanaHistoryEngineMock);
|
|
||||||
cutSpy.initialize(taskanaEngineConfiguration);
|
|
||||||
|
|
||||||
verify(sqlSessionManagerMock, times(2)).getMapper(any());
|
@Test
|
||||||
verify(taskanaHistoryEngineMock, times(2)).getSqlSession();
|
public void testCreateEvent() throws SQLException {
|
||||||
PowerMockito.verifyStatic();
|
HistoryEventImpl expectedWb = AbstractAccTest.createHistoryEvent("wbKey1", "taskId1", "type1", "Some comment",
|
||||||
}
|
"wbKey2");
|
||||||
|
doNothing().when(historyEventMapperMock).insert(expectedWb);
|
||||||
|
|
||||||
@Test
|
cutSpy.create(expectedWb);
|
||||||
public void testCreateEvent() throws SQLException {
|
verify(taskanaHistoryEngineMock, times(1)).openConnection();
|
||||||
HistoryEventImpl expectedWb = AbstractAccTest.createHistoryEvent("wbKey1", "taskId1", "type1", "Some comment", "wbKey2");
|
verify(historyEventMapperMock, times(1)).insert(expectedWb);
|
||||||
doNothing().when(historyEventMapperMock).insert(expectedWb);
|
verify(taskanaHistoryEngineMock, times(1)).returnConnection();
|
||||||
|
assertNotNull(expectedWb.getCreated());
|
||||||
|
}
|
||||||
|
|
||||||
cutSpy.create(expectedWb);
|
@Test
|
||||||
verify(taskanaHistoryEngineMock, times(1)).openConnection();
|
public void testQueryEvent() throws SQLException {
|
||||||
verify(historyEventMapperMock, times(1)).insert(expectedWb);
|
List<HistoryEventImpl> returnList = new ArrayList<>();
|
||||||
verify(taskanaHistoryEngineMock, times(1)).returnConnection();
|
returnList.add(AbstractAccTest.createHistoryEvent("wbKey1", "taskId1", "type1", "Some comment", "wbKey2"));
|
||||||
assertTrue(expectedWb.getCreated() != null);
|
doReturn(returnList).when(historyQueryMapperMock).queryHistoryEvent(any());
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
List<HistoryEventImpl> result = cutSpy.createHistoryQuery().taskIdIn("taskId1").list();
|
||||||
public void testQueryEvent() throws SQLException {
|
|
||||||
List<HistoryEventImpl> returnList = new ArrayList<>();
|
|
||||||
returnList.add(AbstractAccTest.createHistoryEvent("wbKey1", "taskId1", "type1", "Some comment", "wbKey2"));
|
|
||||||
doReturn(returnList).when(historyQueryMapperMock).queryHistoryEvent(any());
|
|
||||||
|
|
||||||
List<HistoryEventImpl> result = cutSpy.createHistoryQuery().taskIdIn("taskId1").list();
|
verify(taskanaHistoryEngineMock, times(1)).openConnection();
|
||||||
|
verify(historyQueryMapperMock, times(1)).queryHistoryEvent(any());
|
||||||
verify(taskanaHistoryEngineMock, times(1)).openConnection();
|
verify(taskanaHistoryEngineMock, times(1)).returnConnection();
|
||||||
verify(historyQueryMapperMock, times(1)).queryHistoryEvent(any());
|
assertEquals(returnList.size(), result.size());
|
||||||
verify(taskanaHistoryEngineMock, times(1)).returnConnection();
|
assertEquals(returnList.get(0).getWorkbasketKey(), result.get(0).getWorkbasketKey());
|
||||||
assertEquals(returnList.size(), result.size());
|
}
|
||||||
assertEquals(returnList.get(0).getWorkbasketKey(), result.get(0).getWorkbasketKey());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue