package com.grayben.riskExtractor.headingMarker;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by beng on 2/12/2015.
 */
public class UnmodifiableTextTest {

    private UnmodifiableText unmodifiableTextSUT = null;

    protected List<String> stringListArgument = null;


    @Rule
    public ExpectedException thrown = ExpectedException.none();

    public UnmodifiableText getUnmodifiableTextSUT() {
        return unmodifiableTextSUT;
    }

    public void setUnmodifiableTextSUT(UnmodifiableText unmodifiableTextSUT) {
        this.unmodifiableTextSUT = unmodifiableTextSUT;
    }

    @Before
    public void setUp() throws Exception {
        stringListArgument = new ArrayList<>();
        stringListArgument.add("one");
        stringListArgument.add("two");
        stringListArgument.add("cow");
        unmodifiableTextSUT = new UnmodifiableText(stringListArgument);
    }

    @After
    final public void tearDownUnmodifiableText() throws Exception {
        unmodifiableTextSUT = null;
        stringListArgument = null;
    }

    @Test
    public void
    test_ConstructingThrowsNullPointerException_WhenStringListIsNull
            () throws Exception {
        thrown.expect(NullPointerException.class);

        stringListArgument = null;

        new UnmodifiableText(stringListArgument);
    }

    @Test
    public void
    test_ConstructingThrowsNullPointerException_WhenPrototypeIsNull
            () throws Exception {
        thrown.expect(NullPointerException.class);

        UnmodifiableText prototype = null;

        new UnmodifiableText(prototype);
    }

    @Test
    public void
    test_ReturnedStringListEqualsStringList
            () throws Exception {
        List<String> returnedStringList = unmodifiableTextSUT.getStringList();
        assert(returnedStringList.equals(stringListArgument));
    }

    @Test
    public void
    test_ReturnedStringListThrowsUnsupportedOperationException_WhenModified
            () throws Exception {
        List<String> returnedStringList = unmodifiableTextSUT.getStringList();

        thrown.expect(UnsupportedOperationException.class);

        returnedStringList.add("something");
    }
}
@@ -179,16 +179,96 @@
 ception;
+%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.runners.MockitoJUnitRunner;
 %0A%0Aimport
@@ -354,16 +354,51 @@
 15.%0A */%0A
+@RunWith(MockitoJUnitRunner.class)%0A
 public c

Add RunWith annotation