package es.tid.cosmos.base.test;

import es.tid.cosmos.base.test.sampleutilities.*;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import static es.tid.cosmos.base.test.UtilityClassTest.assertUtilityClass;

/**
 * @author sortega
 */
public class UtilityClassTestTest {
    @Rule
    public ExpectedException exception = ExpectedException.none();

    @Test
    public void testValidUtilityClass() {
        assertUtilityClass(ValidUtilityClass.class);
        assertUtilityClass(UtilityClassTest.class);
    }

    @Test
    public void testNotFinalUtilityClass() {
        this.exception.expect(AssertionError.class);
        this.exception.expectMessage("Utility class should be final");
        assertUtilityClass(NotFinalUtilityClass.class);
    }

    @Test
    public void testPublicConstructorUtilityClass() {
        this.exception.expect(AssertionError.class);
        this.exception.expectMessage("Utility class should not have " +
                                     "public constructors");
        assertUtilityClass(PublicConstructorUtilityClass.class);
    }

    @Test
    public void testNonStaticUtilityClass() {
        this.exception.expect(AssertionError.class);
        this.exception.expectMessage("Utility class should have static " +
                                     "methods only");
        assertUtilityClass(NonStaticUtilityClass.class);
    }

    @Test
    public void testInvalidConstructorUtilityClass() {
        this.exception.expect(AssertionError.class);
        this.exception.expectMessage("Utility class constructor should have " +
                                     "no arguments");
        assertUtilityClass(InvalidConstructorUtilityClass.class);
    }

    @Test
    public void testInvalidConstructorUtilityClass2() {
        this.exception.expect(AssertionError.class);
        this.exception.expectMessage("Utility class constructor should not " +
                                     "throw exceptions");
        assertUtilityClass(BusyConstructorUtilityClass.class);
    }
}

@@ -31,58 +31,8 @@
 t;%0A%0A
-import es.tid.cosmos.base.test.sampleutilities.*;%0A
 impo
@@ -116,16 +116,66 @@
 ption;%0A%0A
+import es.tid.cosmos.base.test.sampleutilities.*;%0A
 import s

Reorder imports