Search in sources :

Example 6 with ReturnChannelRegistration

use of com.vaadin.flow.internal.nodefeature.ReturnChannelRegistration in project flow by vaadin.

the class ReturnChannelHandlerTest method unregisteredChannel_invocationIgnored.

@Test
public void unregisteredChannel_invocationIgnored() {
    ReturnChannelRegistration registration = registerUiChannel();
    registration.remove();
    handleMessage(registration);
    Assert.assertNull("Channel handler should not be called", observedArguments.get());
}
Also used : ReturnChannelRegistration(com.vaadin.flow.internal.nodefeature.ReturnChannelRegistration) Test(org.junit.Test)

Example 7 with ReturnChannelRegistration

use of com.vaadin.flow.internal.nodefeature.ReturnChannelRegistration in project flow by vaadin.

the class ReturnChannelHandlerTest method disabledElement_defaultRegistration_invocationIgnored.

@Test
public void disabledElement_defaultRegistration_invocationIgnored() {
    ReturnChannelRegistration registration = registerUiChannel();
    ui.setEnabled(false);
    handleMessage(registration);
    Assert.assertNull("Channel handler should not be called", observedArguments.get());
}
Also used : ReturnChannelRegistration(com.vaadin.flow.internal.nodefeature.ReturnChannelRegistration) Test(org.junit.Test)

Aggregations

ReturnChannelRegistration (com.vaadin.flow.internal.nodefeature.ReturnChannelRegistration)7 Test (org.junit.Test)4 StateNode (com.vaadin.flow.internal.StateNode)2 ReturnChannelMap (com.vaadin.flow.internal.nodefeature.ReturnChannelMap)2 JsonObject (elemental.json.JsonObject)2 DisabledUpdateMode (com.vaadin.flow.dom.DisabledUpdateMode)1 JsonCodec (com.vaadin.flow.internal.JsonCodec)1 AbstractRpcInvocationHandler (com.vaadin.flow.server.communication.rpc.AbstractRpcInvocationHandler)1 JsonConstants (com.vaadin.flow.shared.JsonConstants)1 JsonArray (elemental.json.JsonArray)1 ArrayList (java.util.ArrayList)1 Optional (java.util.Optional)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1