From 7a16186cbd2fb3b06085fd17bc6424015077a8e5 Mon Sep 17 00:00:00 2001
From: t-burch <119930761+t-burch@users.noreply.github.com>
Date: Wed, 24 Jul 2024 14:28:36 +0200
Subject: [PATCH] Fix broken integration tests (#1205)
* - Fixed integration test not shutting down router
* - Added exception to ConfigSerializationTest
* Update version in pom's
---
.../membrane/core/rules/SOAPProxyIntegrationTest.java | 8 +++++++-
distribution/examples/basic-xml-interceptor/pom.xml | 2 +-
distribution/examples/custom-interceptor/pom.xml | 2 +-
distribution/examples/soap/add-soap-header/pom.xml | 2 +-
.../membrane/examples/ConfigSerializationTest.java | 3 ++-
5 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/core/src/test/java/com/predic8/membrane/core/rules/SOAPProxyIntegrationTest.java b/core/src/test/java/com/predic8/membrane/core/rules/SOAPProxyIntegrationTest.java
index 35a953736..4ca3c84da 100644
--- a/core/src/test/java/com/predic8/membrane/core/rules/SOAPProxyIntegrationTest.java
+++ b/core/src/test/java/com/predic8/membrane/core/rules/SOAPProxyIntegrationTest.java
@@ -28,17 +28,23 @@
public class SOAPProxyIntegrationTest {
private static Router router;
+ private static Router targetRouter;
@BeforeAll
public static void setup() throws Exception {
Rule rule = new ServiceProxy(new ServiceProxyKey(3000), null, 0);
rule.getInterceptors().add(new SampleSoapServiceInterceptor());
- Router targetRouter = new HttpRouter();
+ targetRouter = new HttpRouter();
targetRouter.getRuleManager().addProxyAndOpenPortIfNew(rule);
targetRouter.init();
}
+ @AfterAll
+ public static void teardown() throws IOException {
+ targetRouter.shutdown();
+ }
+
@BeforeEach
public void startRouter() throws Exception {
router = Router.init("classpath:/soap-proxy.xml");
diff --git a/distribution/examples/basic-xml-interceptor/pom.xml b/distribution/examples/basic-xml-interceptor/pom.xml
index 3c62dd2b4..b44da6a32 100644
--- a/distribution/examples/basic-xml-interceptor/pom.xml
+++ b/distribution/examples/basic-xml-interceptor/pom.xml
@@ -21,7 +21,7 @@
org.membrane-soa
service-proxy-core
- 5.5.2-SNAPSHOT
+ 5.5.5-SNAPSHOT
diff --git a/distribution/examples/custom-interceptor/pom.xml b/distribution/examples/custom-interceptor/pom.xml
index 233ea3990..c1f8fde1f 100644
--- a/distribution/examples/custom-interceptor/pom.xml
+++ b/distribution/examples/custom-interceptor/pom.xml
@@ -28,7 +28,7 @@
org.membrane-soa
service-proxy-core
- 5.5.2-SNAPSHOT
+ 5.5.5-SNAPSHOT
diff --git a/distribution/examples/soap/add-soap-header/pom.xml b/distribution/examples/soap/add-soap-header/pom.xml
index ebe7cfe5f..0e61e8c76 100644
--- a/distribution/examples/soap/add-soap-header/pom.xml
+++ b/distribution/examples/soap/add-soap-header/pom.xml
@@ -21,7 +21,7 @@
org.membrane-soa
service-proxy-core
- 5.5.2-SNAPSHOT
+ 5.5.5-SNAPSHOT
diff --git a/distribution/src/test/java/com/predic8/membrane/examples/ConfigSerializationTest.java b/distribution/src/test/java/com/predic8/membrane/examples/ConfigSerializationTest.java
index ea2beb996..2954eaabb 100644
--- a/distribution/src/test/java/com/predic8/membrane/examples/ConfigSerializationTest.java
+++ b/distribution/src/test/java/com/predic8/membrane/examples/ConfigSerializationTest.java
@@ -66,7 +66,8 @@ public class ConfigSerializationTest {
"validation-security", // throws error because openapi parser does not provide port information
"validation", // throws error because openapi parser does not provide port information
"validation-simple", // throws error because openapi parser does not provide port information
- "template"); // template serialization fails
+ "template", // template serialization fails
+ "greasing"); // greaser interceptor has a child element of type List, this seems to confuse the parser
public static List