@@ -0,0 +1,2520 @@
+package com.collective.celos;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport com.fasterxml.jackson.databind.node.ArrayNode;%0Aimport com.fasterxml.jackson.databind.node.ObjectNode;%0A%0Apublic class AndTriggerTest %7B%0A%0A    @Test%0A    public void returnsTrueWhenAllSubTriggersReturnTrue() throws Exception %7B%0A        ArrayNode subTriggersArray = Util.newArrayNode();%0A        subTriggersArray.add(createAlwaysTriggerConfiguration());%0A        subTriggersArray.add(createAlwaysTriggerConfiguration());%0A        subTriggersArray.add(createAlwaysTriggerConfiguration());%0A        ObjectNode properties = Util.newObjectNode();%0A        properties.put(AndTrigger.TRIGGERS_PROP, subTriggersArray);%0A        AndTrigger trigger = new AndTrigger(properties);%0A        Assert.assertTrue(trigger.isDataAvailable(new ScheduledTime(%222014-02-26T16:13:00Z%22)));%0A    %7D%0A    %0A    @Test%0A    public void returnsFalseWhenOnlyOneSubTriggerReturnsTrue() throws Exception %7B%0A        ArrayNode subTriggersArray = Util.newArrayNode();%0A        subTriggersArray.add(createNeverTriggerConfiguration());%0A        subTriggersArray.add(createAlwaysTriggerConfiguration());%0A        subTriggersArray.add(createNeverTriggerConfiguration());%0A        ObjectNode properties = Util.newObjectNode();%0A        properties.put(AndTrigger.TRIGGERS_PROP, subTriggersArray);%0A        AndTrigger trigger = new AndTrigger(properties);%0A        Assert.assertFalse(trigger.isDataAvailable(new ScheduledTime(%222014-02-26T16:13:00Z%22)));%0A    %7D%0A%0A    @Test%0A    public void returnsFalseWhenNoSubTriggersReturnsTrue() throws Exception %7B%0A        ArrayNode subTriggersArray = Util.newArrayNode();%0A        subTriggersArray.add(createNeverTriggerConfiguration());%0A        subTriggersArray.add(createNeverTriggerConfiguration());%0A        subTriggersArray.add(createNeverTriggerConfiguration());%0A        ObjectNode properties = Util.newObjectNode();%0A        properties.put(AndTrigger.TRIGGERS_PROP, subTriggersArray);%0A        AndTrigger trigger = new AndTrigger(properties);%0A        Assert.assertFalse(trigger.isDataAvailable(new ScheduledTime(%222014-02-26T16:13:00Z%22)));%0A    %7D%0A%0A    private ObjectNode createAlwaysTriggerConfiguration() %7B%0A        ObjectNode config = Util.newObjectNode();%0A        config.put(%22type%22, %22com.collective.celos.AlwaysTrigger%22);%0A        return config;%0A    %7D%0A    %0A    private ObjectNode createNeverTriggerConfiguration() %7B%0A        ObjectNode config = Util.newObjectNode();%0A        config.put(%22type%22, %22com.collective.celos.NeverTrigger%22);%0A        return config;%0A    %7D%0A    %0A%7D%0A

Test AndTrigger.