-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KOGITO-7985] Job service integration tests improvements #1497
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a69358a
KOGITO-7985 Job service integration tests improvements
tiagodolphine c4f0162
fix imports
tiagodolphine 55ac53a
improving quarkus test resources for job service
tiagodolphine 3585294
working version in quarkus-messaging
tiagodolphine 3ec30eb
working version in quarkus-messaging
tiagodolphine e330db4
Adjustments to centralize JosServiceCompose
tiagodolphine d901a80
removing uncessary code and addin ddl form data index
tiagodolphine 812110b
adjusting spring boot IT to use in-memory jobservice container
tiagodolphine 8059dd8
moving quarkus common module and adding more data index tests
tiagodolphine c024e3f
adding more IT with data index, fix repetitive timers
tiagodolphine 7af2987
applying pr comments
tiagodolphine 5ed5810
Moving BaseCallbackStateTimeoutsIT to test folder
tiagodolphine 83811dd
remove abstract test classes from mvn IT execution
tiagodolphine 32af5d4
adding comment to describe why the filesystem persistence is enabled …
tiagodolphine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
38 changes: 0 additions & 38 deletions
38
...us/src/main/java/org/kie/kogito/test/resources/AbstractJobServiceQuarkusTestResource.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
...arkus/src/main/java/org/kie/kogito/test/resources/JobServiceKafkaQuarkusTestResource.java
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
...on-quarkus/src/main/java/org/kie/kogito/test/resources/JobServiceQuarkusTestResource.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.awaitility.Awaitility.await; | ||
import static org.hamcrest.CoreMatchers.notNullValue; | ||
import static org.kie.kogito.test.TestUtils.assertJobsAndProcessOnDataIndex; | ||
|
||
public abstract class BaseProcessTimerIT implements JobServiceHealthAware { | ||
|
||
|
@@ -42,11 +43,16 @@ public abstract class BaseProcessTimerIT implements JobServiceHealthAware { | |
//Timers Tests | ||
@Test | ||
public void testTimers() { | ||
String id = createTimer(new RequestPayload("PT02S"), TIMERS); | ||
String id = createTimer(new RequestPayload("PT01S"), TIMERS); | ||
Object id2 = getTimerById(id, TIMERS); | ||
assertThat(id).isEqualTo(id2); | ||
await().atMost(TIMEOUT) | ||
.untilAsserted(() -> getTimerWithStatusCode(id, 404, TIMERS)); | ||
assertJobsAndProcessOnDataIndex(dataIndexUrl(), TIMERS, id, "COMPLETED", "EXECUTED", TIMEOUT); | ||
} | ||
|
||
public String dataIndexUrl() { | ||
return null; | ||
} | ||
|
||
@Test | ||
|
@@ -55,6 +61,7 @@ public void testCancelTimer() { | |
Object id2 = deleteTimer(id, TIMERS); | ||
assertThat(id).isEqualTo(id2); | ||
getTimerWithStatusCode(id, 404, TIMERS); | ||
assertJobsAndProcessOnDataIndex(dataIndexUrl(), TIMERS, id, "ABORTED", "CANCELED", TIMEOUT); | ||
} | ||
|
||
//Cycle Timers Tests | ||
|
@@ -64,25 +71,31 @@ public void testTimerCycle() { | |
String id2 = getTimerById(id, TIMERS_CYCLE); | ||
assertThat(id).isEqualTo(id2); | ||
await().atMost(TIMEOUT) | ||
.untilAsserted(() -> getTimerWithStatusCode(id, 404, TIMERS)); | ||
.untilAsserted(() -> getTimerWithStatusCode(id, 404, TIMERS_CYCLE)); | ||
assertJobsAndProcessOnDataIndex(dataIndexUrl(), TIMERS_CYCLE, id, "COMPLETED", "EXECUTED", TIMEOUT); | ||
} | ||
|
||
@Test | ||
public void testDeleteTimerCycle() { | ||
String id = createTimer(new RequestPayload("R20/PT1S"), TIMERS_CYCLE); | ||
String id = createTimer(new RequestPayload("R20/PT10S"), TIMERS_CYCLE); | ||
String id2 = getTimerById(id, TIMERS_CYCLE); | ||
assertThat(id).isEqualTo(id2); | ||
deleteTimer(id, TIMERS_CYCLE); | ||
await().atMost(TIMEOUT) | ||
.untilAsserted(() -> getTimerWithStatusCode(id, 404, TIMERS_CYCLE)); | ||
await().atMost(TIMEOUT) | ||
.untilAsserted(() -> assertJobsAndProcessOnDataIndex(dataIndexUrl(), TIMERS_CYCLE, id, "ABORTED", "CANCELED", TIMEOUT)); | ||
} | ||
|
||
//Boundary Timers Tests | ||
@Test | ||
public void testBoundaryTimersOnTask() { | ||
String id = createTimer(new RequestPayload("PT02S"), TIMERS_ON_TASK); | ||
String id = createTimer(new RequestPayload("PT01S"), TIMERS_ON_TASK); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here "01" |
||
String id2 = getTimerById(id, TIMERS_ON_TASK); | ||
assertThat(id).isEqualTo(id2); | ||
await().atMost(TIMEOUT) | ||
.untilAsserted(() -> getTimerWithStatusCode(id, 404, TIMERS_ON_TASK)); | ||
assertJobsAndProcessOnDataIndex(dataIndexUrl(), TIMERS_ON_TASK, id, "COMPLETED", "EXECUTED", TIMEOUT); | ||
} | ||
|
||
@Test | ||
|
@@ -91,6 +104,7 @@ public void testDeleteBoundaryTimersOnTask() { | |
String id2 = getTimerById(id, TIMERS_ON_TASK); | ||
assertThat(id).isEqualTo(id2); | ||
deleteTimer(id, TIMERS_ON_TASK); | ||
assertJobsAndProcessOnDataIndex(dataIndexUrl(), TIMERS_ON_TASK, id, "ABORTED", "CANCELED", TIMEOUT); | ||
} | ||
|
||
private ValidatableResponse getTimerWithStatusCode(String id, int code, String path) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
...ervice-common/src/main/java/org/kie/kogito/test/resources/AbstractJobServiceResource.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
silly comment, but I believe "01" shouldn't be needed here, "PT1S" sounds more natural in my opinion.