package rod;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/analyzers.xml"})
public class DummyAnalyzerTest {

    @Autowired
    private DummyAnalyzer dummyAnalyzer;

    @Test
    public void testAnalyzeDummyObervation() throws Exception {
        Command command = dummyAnalyzer.analyze(new DummyObservation());

        assertThat(command, instanceOf(NopCommand.class));
    }

}

@@ -762,10 +762,388 @@
 %0A    %7D%0A%0A
+    @Test(expected = UnrecognizableObservationException.class)%0A    public void testAnalyzeUnexpecetdObservation() throws Exception %7B%0A        Observation observation = new Observation() %7B%0A            @Override%0A            public Resource origin() %7B%0A                return DummyResource.getSingleton();%0A            %7D%0A        %7D;%0A%0A        dummyAnalyzer.analyze(observation);%0A    %7D%0A%0A
 %7D%0A

Test case when observation is unexpected