diff --git a/dev/com.ibm.ws.microprofile.openapi_fat/fat/src/com/ibm/ws/microprofile/openapi/fat/ApplicationProcessorTest.java b/dev/com.ibm.ws.microprofile.openapi_fat/fat/src/com/ibm/ws/microprofile/openapi/fat/ApplicationProcessorTest.java index 864199adc803..2d16a3f9bf2a 100644 --- a/dev/com.ibm.ws.microprofile.openapi_fat/fat/src/com/ibm/ws/microprofile/openapi/fat/ApplicationProcessorTest.java +++ b/dev/com.ibm.ws.microprofile.openapi_fat/fat/src/com/ibm/ws/microprofile/openapi/fat/ApplicationProcessorTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018 IBM Corporation and others. + * Copyright (c) 2018, 2021 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -84,6 +84,11 @@ public static void setUpTest() throws Exception { assertNotNull("Server did not report that it has started", server.waitForStringInLog("CWWKF0011I.*")); + assertNotNull("Http port not opened", + server.waitForStringInLog("CWWKO0219I.* defaultHttpEndpoint ")); // Wait for http port + assertNotNull("Https port not opened", + server.waitForStringInLog("CWWKO0219I.* defaultHttpEndpoint-ssl ")); // Wait for https port to open (this + // can sometimes take a while) } /** diff --git a/dev/io.openliberty.microprofile.openapi.2.0.internal/src/io/openliberty/microprofile/openapi20/DefaultHostListener.java b/dev/io.openliberty.microprofile.openapi.2.0.internal/src/io/openliberty/microprofile/openapi20/DefaultHostListener.java index 3ae97b5cffde..b2a10f0af6a7 100644 --- a/dev/io.openliberty.microprofile.openapi.2.0.internal/src/io/openliberty/microprofile/openapi20/DefaultHostListener.java +++ b/dev/io.openliberty.microprofile.openapi.2.0.internal/src/io/openliberty/microprofile/openapi20/DefaultHostListener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020 IBM Corporation and others. + * Copyright (c) 2020, 2021 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -61,7 +61,9 @@ public static DefaultHostListener getInstance() { * The ServerInfo object for the default_host virtual host. */ public ServerInfo getDefaultHostServerInfo() { - return defaultHostServerInfo; + synchronized(defaultHostServerInfo) { + return new ServerInfo(defaultHostServerInfo); + } } @Activate @@ -139,4 +141,4 @@ private void updateDefaultHostServerInfo(VirtualHost vhost, Map Tr.event(this, tc, "Updated server information: " + defaultHostServerInfo); } } -} \ No newline at end of file +}