package seedu.ezdo.model;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import seedu.ezdo.commons.exceptions.IllegalValueException;
import seedu.ezdo.model.todo.Task;
import seedu.ezdo.model.todo.UniqueTaskList.DuplicateTaskException;
import seedu.ezdo.model.util.SampleDataUtil;

@RunWith(PowerMockRunner.class)
@PrepareForTest({Task.class, SampleDataUtil.class, EzDo.class})
public class SampleDataUtilTest {

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

    @Test
    public void getSampleTasks_ive_throwsAssertionError() throws Exception {
        thrown.expect(AssertionError.class);
        PowerMockito.whenNew(Task.class).withAnyArguments().thenThrow(new IllegalValueException("ive"));
        SampleDataUtil.getSampleTasks();
    }

    @Test
    public void getSampleEzDo_duplicateTask_throwsAssertionError() throws Exception {
        thrown.expect(AssertionError.class);
        PowerMockito.whenNew(EzDo.class).withAnyArguments().thenThrow(new DuplicateTaskException());
        SampleDataUtil.getSampleEzDo();
    }

}

@@ -145,174 +145,78 @@
 th;%0A
+%0A
 import 
-org.powermock.api.mockito.PowerMockito;%0Aimport org.powermock.core.classloader.annotations.PrepareForTest;%0Aimport org.powermock.modules.junit4.PowerMockRunner;%0A
+mockit.Expectations;%0Aimport mockit.integration.junit4.JMockit;
 %0Aimp
@@ -301,20 +301,20 @@
 el.todo.
-Task
+Name
 ;%0Aimport
@@ -434,93 +434,21 @@
 ith(
-PowerMockRunner.class)%0A@PrepareForTest(%7BTask.class, SampleDataUtil.class, EzDo.class%7D
+JMockit.class
 )%0Apu
@@ -699,104 +699,151 @@
     
-PowerMockito.whenNew(Task.class).withAnyArguments().thenThrow(new IllegalValueException(%22ive%22));
+new Expectations(Name.class) %7B%7B%0A            new Name(%22Buy one cherry fruit%22); result = new IllegalValueException(%22illegal value%22);%0A        %7D%7D;%0A
 %0A   
@@ -1040,70 +1040,73 @@
     
-PowerMockito.whenNew(EzDo.class).withAnyArguments().thenThrow(
+new Expectations(EzDo.class) %7B%7B%0A            new EzDo(); result = 
 new 
@@ -1129,17 +1129,28 @@
 eption()
-)
+;%0A        %7D%7D
 ;%0A      

Change to JMockit