use of org.pentaho.platform.web.gwt.rpc.IGwtRpcSerializationPolicyCache in project pentaho-platform by pentaho.
the class AbstractGwtRpcRequestMatcherTest method testConstructWithSerializationPolicyCache.
// endregion
// region Serialization Policy Cache
@Test
public void testConstructWithSerializationPolicyCache() {
IGwtRpcSerializationPolicyCache cache = mock(IGwtRpcSerializationPolicyCache.class);
AbstractGwtRpcRequestMatcher matcher = new TestRequestMatcher(TEST_PATTERN, TEST_RPC_METHODS_SINGLE, cache);
assertEquals(cache, matcher.getSerializationPolicyCache());
}
use of org.pentaho.platform.web.gwt.rpc.IGwtRpcSerializationPolicyCache in project pentaho-platform by pentaho.
the class SystemGwtRpcRequestMatcherTest method testGetGwtRpcReturnsASystemGwtRpc.
// endregion
// region getGwtRpc integration
@Test
public void testGetGwtRpcReturnsASystemGwtRpc() {
HttpServletRequest requestMock = createRequestMock(HttpMethod.POST, TEST_PATH);
IGwtRpcSerializationPolicyCache serializationPolicyCache = (moduleBaseURL, strongName, sourceProvider) -> {
throw new UnsupportedOperationException();
};
SystemGwtRpcRequestMatcher matcher = spy(new SystemGwtRpcRequestMatcher(TEST_PATTERN, TEST_RPC_METHODS_SINGLE, serializationPolicyCache));
// ---
AbstractGwtRpc gwtRpc = matcher.getGwtRpc(requestMock);
assertNotNull(gwtRpc);
assertTrue(gwtRpc instanceof SystemGwtRpc);
assertEquals(requestMock, gwtRpc.getServletRequest());
assertEquals(serializationPolicyCache, gwtRpc.getSerializationPolicyCache());
}
use of org.pentaho.platform.web.gwt.rpc.IGwtRpcSerializationPolicyCache in project pentaho-platform by pentaho.
the class PluginGwtRpcRequestMatcherTest method testGetGwtRpcReturnsAPluginGwtRpc.
// endregion
// region getGwtRpc integration
@Test
public void testGetGwtRpcReturnsAPluginGwtRpc() {
HttpServletRequest requestMock = createRequestMock(HttpMethod.POST, TEST_PATH);
IGwtRpcSerializationPolicyCache serializationPolicyCache = (moduleBaseURL, strongName, sourceProvider) -> {
throw new UnsupportedOperationException();
};
PluginGwtRpcRequestMatcher matcher = spy(new PluginGwtRpcRequestMatcher(TEST_PATTERN, TEST_RPC_METHODS_SINGLE, serializationPolicyCache));
// ---
AbstractGwtRpc gwtRpc = matcher.getGwtRpc(requestMock);
assertNotNull(gwtRpc);
assertTrue(gwtRpc instanceof PluginGwtRpc);
assertEquals(requestMock, gwtRpc.getServletRequest());
assertEquals(serializationPolicyCache, gwtRpc.getSerializationPolicyCache());
}
Aggregations