/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.mail.internal;

import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;

import org.junit.Rule;
import org.junit.Test;
import org.xwiki.mail.MailStatus;
import org.xwiki.mail.MailStatusStore;
import org.xwiki.test.AllLogRule;

import static org.mockito.Mockito.*;
import static org.junit.Assert.*;

/**
 * Unit tests for {@link org.xwiki.mail.internal.DatabaseMailStatusResult}.
 *
 * @version $Id$
 * @since 6.4RC1
 */
public class DatabaseMailStatusResultTest
{
    @Rule
    public AllLogRule logRule = new AllLogRule();

    @Test
    public void getAll() throws Exception
    {
        MailStatusStore store = mock(MailStatusStore.class);
        MailStatus status = new MailStatus();
        when(store.load(Collections.<String, Object>singletonMap("batchId", "batchid"), 0, 0, "date", true))
            .thenReturn(Arrays.asList(status));

        DatabaseMailStatusResult result = new DatabaseMailStatusResult(store);
        result.setBatchId("batchid");

        Iterator<MailStatus> resultStatuses = result.getAll();
        MailStatus resultStatus = resultStatuses.next();
        assertSame(status, resultStatus);
        assertFalse(resultStatuses.hasNext());
    }
}

@@ -1025,30 +1025,19 @@
 nit.
-Rule;%0Aimport org.junit
+jupiter.api
 .Tes
@@ -1138,21 +1138,158 @@
 est.
-AllLogRul
+junit5.mockito.ComponentTest;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertFalse;%0Aimport static org.junit.jupiter.api.Assertions.assertSam
 e;%0A
-%0A
 impo
@@ -1324,42 +1324,8 @@
 o.*;
-%0Aimport static org.junit.Assert.*;
 %0A%0A/*
@@ -1443,23 +1443,31 @@
 RC1%0A */%0A
-public 
+@ComponentTest%0A
 class Da
@@ -1499,69 +1499,8 @@
 t%0A%7B%0A
-    @Rule%0A    public AllLogRule logRule = new AllLogRule();%0A%0A
     
@@ -1513,15 +1513,8 @@
     
-public 
 void
@@ -1693,24 +1693,8 @@
 ons.
-%3CString, Object%3E
 sing

Convert to a JUnit5 test