Skip to content

Commit 6746077

Browse files
committed
cleanup
1 parent cf38a82 commit 6746077

File tree

7 files changed

+34
-11
lines changed

7 files changed

+34
-11
lines changed

example/src/main/resources/application-mssql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ spring:
88
maximum-pool-size: 100
99
jpa:
1010
hibernate:
11-
ddl-auto: update
11+
ddl-auto: create-drop
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.sterl.spring.persistent_tasks.example;
1+
package org.sterl.spring.example_app;
22

33
import org.junit.jupiter.api.Test;
44
import org.springframework.boot.test.context.SpringBootTest;

pom.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@
105105
<target>${java.version}</target>
106106
<encoding>${project.reporting.outputEncoding}</encoding>
107107
<compilerArgs>
108-
<arg>-Xlint:all,-options,-path,-parameters</arg>
108+
<arg>-Xlint:all</arg>
109+
<arg>-Xlint:-options</arg>
110+
<arg>-Xlint:-path</arg>
111+
<arg>-parameters</arg>
109112
</compilerArgs>
110113
</configuration>
111114
</plugin>
@@ -122,8 +125,7 @@
122125
<failOnViolation>true</failOnViolation>
123126
<printFailingErrors>true</printFailingErrors>
124127
<analysisCache>true</analysisCache>
125-
<analysisCacheLocation>
126-
${project.build.directory}/pmd/pmd.cache</analysisCacheLocation>
128+
<analysisCacheLocation>${project.build.directory}/pmd/pmd.cache</analysisCacheLocation>
127129
</configuration>
128130
<executions>
129131
<execution>

spring-persistent-tasks-db/src/test/java/org/sterl/spring/persistent_tasks/db/ApplyLiquibaseTest.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.sterl.spring.persistent_tasks.db;
22

3-
import java.util.List;
3+
import static org.assertj.core.api.Assertions.assertThat;
4+
45
import java.util.Map;
56

67
import javax.sql.DataSource;
@@ -19,7 +20,7 @@ class ApplyLiquibaseTest {
1920

2021
@Test
2122
void test() throws Exception {
22-
var dataSource = mssqlDb();
23+
var dataSource = h2Db();
2324
try (Database database = DatabaseFactory.getInstance()
2425
.findCorrectDatabaseImplementation(
2526
new liquibase.database.jvm.JdbcConnection(dataSource.getConnection()))) {
@@ -40,10 +41,28 @@ void test() throws Exception {
4041
}
4142

4243
var template = new JdbcTemplate(dataSource);
43-
final List<Map<String, Object>> var = template.queryForList("SHOW TABLES");
44-
for (Map<String, Object> map : var) {
44+
final var tables = template.queryForList("SHOW TABLES");
45+
for (Map<String, Object> map : tables) {
4546
System.err.println(map);
4647
}
48+
assertThat(tables).contains(
49+
Map.of("TABLE_NAME", "PT_DATABASECHANGELOG",
50+
"TABLE_SCHEMA", "PUBLIC"));
51+
assertThat(tables).contains(
52+
Map.of("TABLE_NAME", "PT_DATABASECHANGELOGLOCK",
53+
"TABLE_SCHEMA", "PUBLIC"));
54+
assertThat(tables).contains(
55+
Map.of("TABLE_NAME", "PT_SCHEDULER",
56+
"TABLE_SCHEMA", "PUBLIC"));
57+
assertThat(tables).contains(
58+
Map.of("TABLE_NAME", "PT_TASK_TRIGGERS",
59+
"TABLE_SCHEMA", "PUBLIC"));
60+
assertThat(tables).contains(
61+
Map.of("TABLE_NAME", "PT_TRIGGER_HISTORY_DETAILS",
62+
"TABLE_SCHEMA", "PUBLIC"));
63+
assertThat(tables).contains(
64+
Map.of("TABLE_NAME", "PT_TRIGGER_HISTORY_LAST_STATES",
65+
"TABLE_SCHEMA", "PUBLIC"));
4766
}
4867

4968
private JdbcDataSource h2Db() {

spring-persistent-tasks-ui/src/shared/http-error.view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Alert, Col, Row } from "react-bootstrap";
1+
import { Alert } from "react-bootstrap";
22

33
const HttpErrorView = ({ error }: { error: any }) => {
44
if (!error) return undefined;

spring-persistent-tasks/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<groupId>${project.groupId}</groupId>
4646
<artifactId>spring-persistent-tasks-db</artifactId>
4747
<version>${project.version}</version>
48+
<scope>test</scope>
4849
</dependency>
4950

5051
<dependency>

spring-persistent-tasks/src/test/java/org/sterl/spring/persistent_tasks/trigger/TriggerServiceTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.time.OffsetDateTime;
77
import java.util.ArrayList;
88
import java.util.Arrays;
9+
import java.util.Optional;
910
import java.util.concurrent.Callable;
1011
import java.util.concurrent.Executors;
1112

@@ -256,7 +257,7 @@ void testLockTrigger() throws Exception {
256257
}
257258

258259
// WHEN
259-
ArrayList<Callable<?>> lockInvocations = new ArrayList<>();
260+
ArrayList<Callable<Optional<TriggerEntity> >> lockInvocations = new ArrayList<>();
260261
for (int i = 1; i <= 100; ++i) {
261262
lockInvocations.add(() -> runNextTrigger());
262263
}

0 commit comments

Comments
 (0)