added PushStateDispatcher for production and development to WebResourceServlet

This commit is contained in:
Sebastian Sdorra
2018-08-23 11:48:42 +02:00
parent 9e8bd299f0
commit 0fc09f5c0d
10 changed files with 452 additions and 15 deletions

View File

@@ -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);
}
}