diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/GatewayServerTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/GatewayServerTest.java index c6402877be..4ad86d3264 100644 --- a/gateway-server/src/test/java/org/apache/knox/gateway/GatewayServerTest.java +++ b/gateway-server/src/test/java/org/apache/knox/gateway/GatewayServerTest.java @@ -21,7 +21,6 @@ import org.apache.knox.gateway.config.impl.GatewayConfigImpl; import org.easymock.EasyMock; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -48,7 +47,6 @@ public void setup() { } @Test - @Ignore public void testRefreshGatewayConfig() throws Exception { GatewayConfigImpl config = EasyMock.createNiceMock(GatewayConfigImpl.class); @@ -65,6 +63,11 @@ public void testRefreshGatewayConfig() throws Exception { Method refreshMethod = GatewayServer.class.getDeclaredMethod("refreshGatewayConfig", GatewayConfigImpl.class, Path.class); refreshMethod.setAccessible(true); + // Reset static lastReloadTime to ensure test isolation + Field lastReloadTimeField = GatewayServer.class.getDeclaredField("lastReloadTime"); + lastReloadTimeField.setAccessible(true); + lastReloadTimeField.set(null, null); + // Initial load config.reloadConfiguration(); EasyMock.expectLastCall().once(); @@ -75,8 +78,6 @@ public void testRefreshGatewayConfig() throws Exception { EasyMock.verify(config); // Check lastReloadTime is set - Field lastReloadTimeField = GatewayServer.class.getDeclaredField("lastReloadTime"); - lastReloadTimeField.setAccessible(true); FileTime lastReloadTime = (FileTime) lastReloadTimeField.get(null); assertNotNull(lastReloadTime);