Skip to content

Commit e6f7c49

Browse files
committed
avoid misleading errors on shutdown if startup failed
1 parent 82b27d4 commit e6f7c49

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

dd-java-agent/instrumentation/mule-4/src/test/groovy/mule4/MuleForkedTest.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ class MuleForkedTest extends WithHttpServer<MuleTestContainer> {
7777

7878
@Override
7979
void stopServer(MuleTestContainer container) {
80-
container.undeploy(String.valueOf(buildProperties.get(TEST_APPLICATION_NAME)))
81-
container.stop()
80+
if (container != null) {
81+
container.undeploy(String.valueOf(buildProperties.get(TEST_APPLICATION_NAME)))
82+
container.stop()
83+
}
8284
}
8385

8486
def "test mule client remote request"() {

dd-java-agent/instrumentation/mule-4/src/test/groovy/mule4/MuleHttpServerForkedTest.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ class MuleHttpServerForkedTest extends HttpServerTest<MuleTestContainer> {
9595

9696
@Override
9797
void stopServer(MuleTestContainer container) {
98-
container.undeploy(String.valueOf(buildProperties.get(MuleTestApplicationConstants.TEST_APPLICATION_NAME)))
99-
container.stop()
98+
if (container != null) {
99+
container.undeploy(String.valueOf(buildProperties.get(MuleTestApplicationConstants.TEST_APPLICATION_NAME)))
100+
container.stop()
101+
}
100102
}
101103
}
102104

0 commit comments

Comments
 (0)