Skip to content

Commit

Permalink
#49 Fixed some unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcweba committed Jun 5, 2024
1 parent 2b37662 commit 108ccce
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.swisspush.gateleen.queue.expiry;

import io.restassured.RestAssured;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.unit.Async;
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
Expand Down Expand Up @@ -36,6 +37,14 @@ public void initRestAssured() {
RestAssured.requestSpecification.basePath(SERVER_ROOT + "/");
}

private void initRoutingRules() {
// add a routing
JsonObject rules = new JsonObject();
rules = TestUtils.addRoutingRuleMainStorage(rules);
rules = TestUtils.addRoutingRuleQueuing(rules);
TestUtils.putRoutingRules(rules);
}

/**
* Checks if the GET request of the
* given resource returns the wished body.
Expand All @@ -55,6 +64,7 @@ private void checkGETBodyWithAwait(final String requestUrl, final String body) {
public void testQueueExpiry(TestContext context) {
Async async = context.async();
delete();
initRoutingRules();

System.out.println("testQueueExpiry");

Expand Down Expand Up @@ -165,6 +175,7 @@ public void testQueueExpiry(TestContext context) {
public void testQueueExpiryOverride_requestIsExpired_beforeRegularExpiryTime(TestContext context) {
Async async = context.async();
delete();
initRoutingRules();

System.out.println("testQueueExpiry");

Expand Down Expand Up @@ -213,6 +224,7 @@ public void testQueueExpiryOverride_requestIsExpired_beforeRegularExpiryTime(Tes
public void testQueueExpiryOverride_requestIsNotExpired_regularResourceExpiry(TestContext context) {
Async async = context.async();
delete();
initRoutingRules();

System.out.println("testQueueExpiry");

Expand Down

0 comments on commit 108ccce

Please sign in to comment.