package leigh.mecha.nodegraph;

import org.junit.Test;

import java.io.Serializable;
import java.util.UUID;

import static org.junit.Assert.assertEquals;

public class RemoteAttributeTest {
    @Test
    public void testRemoteNode() throws Exception {
        Node remoteNode = new Node(UUID.randomUUID().toString()) {
            public Serializable getOutputSingle(String key, ProcessorState state) throws Exception {
                if (key.equals("value")) {
                    return "Hello World";
                }
                return super.getOutputSingle(key, state);
            }
        };

        RemoteAttribute ra = new RemoteAttribute(remoteNode, "value");
        assertEquals("Hello World", ra.getSingleValue(new ProcessorState()));
    }
}
