Skip to content

Commit

Permalink
TSK-1142 Removed JUnit4 dependency in taskana-simplehistory-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
sofie29 committed Mar 5, 2020
1 parent 32d069a commit 6c6a278
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 185 deletions.
20 changes: 4 additions & 16 deletions history/taskana-simplehistory-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${version.junit.jupiter}</version>
<scope>test</scope>
</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>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${version.junit.mockito}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -93,5 +81,5 @@
<version>${version.h2}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
@Override
public void initialize(TaskanaEngineConfiguration taskanaEngineConfiguration) {
try {
this.taskanaHistoryEngine =
TaskanaHistoryEngineImpl.createTaskanaEngine(taskanaEngineConfiguration);
this.taskanaHistoryEngine = getTaskanaEngine(taskanaEngineConfiguration);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(
"Simple history service implementation initialized with schemaName: {} ",
Expand Down Expand Up @@ -59,4 +58,12 @@ public void create(TaskanaHistoryEvent event) {
public HistoryQuery createHistoryQuery() {
return new HistoryQueryImpl(taskanaHistoryEngine, historyQueryMapper);
}

/*
* ATTENTION: This method exists for testing purposes.
*/
TaskanaHistoryEngineImpl getTaskanaEngine(TaskanaEngineConfiguration taskanaEngineConfiguration)
throws SQLException {
return TaskanaHistoryEngineImpl.createTaskanaEngine(taskanaEngineConfiguration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.Properties;
import javax.sql.DataSource;
import org.apache.ibatis.datasource.pooled.PooledDataSource;
import org.junit.BeforeClass;
import org.junit.jupiter.api.BeforeAll;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -45,7 +45,7 @@ protected AbstractAccTest() {
// not called
}

@BeforeClass
@BeforeAll
public static void setupTest() throws Exception {
resetDb(null);
}
Expand Down
Loading

0 comments on commit 6c6a278

Please sign in to comment.