@@ -0,0 +1,2698 @@
+package jfditests.logictests.commandstests;%0A%0Aimport jfdi.logic.commands.ListCommand;%0Aimport jfdi.storage.records.Task;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.powermock.core.classloader.annotations.PrepareForTest;%0Aimport org.powermock.modules.junit4.PowerMockRunner;%0A%0Aimport java.util.Collection;%0Aimport java.util.function.Consumer;%0A%0Aimport static org.junit.Assert.*;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.powermock.api.mockito.PowerMockito.*;%0A%0A/**%0A * @author Liu Xinan%0A */%0A@RunWith(PowerMockRunner.class)%0A@PrepareForTest(%7BTask.class%7D)%0Apublic class ListCommandTest %7B%0A%0A    @Mock private Collection%3CTask%3E items;%0A    @Mock private Consumer%3CListCommand%3E successHook;%0A    @Mock private Consumer%3CListCommand%3E failureHook;%0A%0A    private ListCommand listCommandWithTags = new ListCommand.Builder().addTag(%22test%22).build();%0A    private ListCommand listCommandWithoutTags = new ListCommand.Builder().build();%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        mockStatic(Task.class);%0A        when(Task.getAll()).thenReturn(items);%0A    %7D%0A%0A    @Test%0A    public void testGetItems() throws Exception %7B%0A        // Command must be executed before there is any items to be gotten.%0A        listCommandWithoutTags.execute();%0A%0A        assertSame(items, listCommandWithoutTags.getItems());%0A    %7D%0A%0A    @Test%0A    public void testGetErrorType() throws Exception %7B%0A        assertNull(listCommandWithTags.getErrorType());%0A%0A        listCommandWithTags.execute();%0A        assertEquals(listCommandWithTags.getErrorType(), ListCommand.ErrorType.UNKNOWN);%0A    %7D%0A%0A    @Test%0A    public void testExecute() throws Exception %7B%0A        listCommandWithoutTags.execute();%0A%0A        verifyStatic();%0A        Task.getAll(); // @CheckReturnValue%0A    %7D%0A%0A    @Test%0A    public void testOnSuccess() throws Exception %7B%0A        ListCommand.addSuccessHook(successHook);%0A        listCommandWithoutTags.execute();%0A%0A        verify(successHook).accept(listCommandWithoutTags);%0A    %7D%0A%0A    @Test%0A    public void testOnFailure() throws Exception %7B%0A        ListCommand.addFailureHook(failureHook);%0A        listCommandWithTags.execute();%0A%0A        verify(failureHook).accept(listCommandWithTags);%0A    %7D%0A%0A    @Test%0A    public void testAddSuccessHook() throws Exception %7B%0A        ListCommand.addSuccessHook(successHook);%0A        listCommandWithoutTags.execute();%0A%0A        verify(successHook).accept(listCommandWithoutTags);%0A    %7D%0A%0A    @Test%0A    public void testAddFailureHook() throws Exception %7B%0A        ListCommand.addFailureHook(failureHook);%0A        listCommandWithTags.execute();%0A%0A        verify(failureHook).accept(listCommandWithTags);%0A    %7D%0A%7D%0A

Add tests for `ListCommand`