Skip to content

Re-starting Server no longer works #263

Closed
@logi

Description

Unit tests which call Server.start() in a before() method and Server.stop() in an after() method have just stopped working.

These tests will succeed with 1.5.17 but with a 1.5.18 built today (15.08.2018) the first will succeed and the second will fail:

public class ServerRestartTest {

    @Test
    public void testStartStop1() {
        Server.start();
        Server.stop();
    }

    @Test
    public void testStartStop2() {
        Server.start();
        Server.stop();
    }

}

The exception raised is:

java.lang.IllegalStateException: UT000071: Cannot add path template /graphql, matcher already contains an equivalent pattern /graphql

	at io.undertow.util.PathTemplateMatcher.add(PathTemplateMatcher.java:109)
	at io.undertow.util.PathTemplateMatcher.add(PathTemplateMatcher.java:150)
	at com.networknt.handler.Handler.initPaths(Handler.java:119)
	at com.networknt.handler.Handler.init(Handler.java:52)
	at com.networknt.server.Server.start(Server.java:145)
	at is.thing.usernotes.rest.ServerRestartTest.testStartStop2(ServerRestartTest.java:16)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions