mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 02:31:14 +01:00
added PushStateDispatcher for production and development to WebResourceServlet
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package sonia.scm;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class PushStateDispatcherProviderTest {
|
||||
|
||||
private PushStateDispatcherProvider provider = new PushStateDispatcherProvider();
|
||||
|
||||
@Test
|
||||
public void testGetProxyPushStateWithPropertySet() {
|
||||
System.setProperty(PushStateDispatcherProvider.PROPERTY_TARGET, "http://localhost:9966");
|
||||
PushStateDispatcher dispatcher = provider.get();
|
||||
Assertions.assertThat(dispatcher).isInstanceOf(ProxyPushStateDispatcher.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetProxyPushStateWithoutProperty() {
|
||||
PushStateDispatcher dispatcher = provider.get();
|
||||
Assertions.assertThat(dispatcher).isInstanceOf(ForwardingPushStateDispatcher.class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanupSystemProperty() {
|
||||
System.clearProperty(PushStateDispatcherProvider.PROPERTY_TARGET);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user