use of org.pentaho.platform.web.gwt.rpc.SystemGwtRpc 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());
}
Aggregations