package com.salesforce.storm.spout.sideline;

import org.junit.Test;

import static org.junit.Assert.*;

public class VirtualSpoutIdentifierTest {

    /**
     * Test that two identifiers created with the same string match
     * @throws Exception Bad identifier
     */
    @Test
    public void test_toString_and_equals() throws Exception {
        final VirtualSpoutIdentifier virtualSpoutIdentifier = new VirtualSpoutIdentifier("FooBar");

        assertEquals(virtualSpoutIdentifier, new VirtualSpoutIdentifier("FooBar"));
        assertEquals(virtualSpoutIdentifier.toString(), new VirtualSpoutIdentifier("FooBar").toString());
    }

    /**
     * Test that supplying null will throw an exception
     */
    @Test(expected = IllegalArgumentException.class)
    public void test_nullIdentifier() {
        new VirtualSpoutIdentifier(null);
    }

    /**
     * Test that supplying an empty string will throw an exception
     */
    @Test(expected = IllegalArgumentException.class)
    public void test_emptyIdentifier() {
        new VirtualSpoutIdentifier("");
    }
}
@@ -627,32 +627,605 @@
 ring());%0A    %7D%0A%0A
+    /**%0A     * Test that two identifiers that are different do not match%0A     * @throws Exception Bad identifier%0A     */%0A    @Test%0A    public void test_not_toString_and_equals() throws Exception %7B%0A        final VirtualSpoutIdentifier virtualSpoutIdentifier1 = new VirtualSpoutIdentifier(%22Foo%22);%0A        final VirtualSpoutIdentifier virtualSpoutIdentifier2 = new VirtualSpoutIdentifier(%22Bar%22);%0A%0A        assertNotEquals(virtualSpoutIdentifier1, virtualSpoutIdentifier2);%0A        assertNotEquals(virtualSpoutIdentifier1.toString(), virtualSpoutIdentifier2.toString());%0A    %7D%0A%0A
     /**%0A     * T

Add negative test