package sb.tasks.models.metafile;

import java.util.Calendar;
import java.util.GregorianCalendar;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import sb.tasks.jobs.trupd.TorrentResultTest;

public class MetafileTest {

    private Metafile mt;

    @Before
    public void setUp() throws Exception {
        byte[] bytes;
        try (var is = TorrentResultTest.class.getResourceAsStream("/tor.torrent")) {
            Assert.assertNotNull(is);
            bytes = is.readAllBytes();
        }
        mt = new Metafile(bytes);
    }

    @Test
    public void testName() {
        Assert.assertEquals("Михайлов В.С. и др. - Растительно-молочно-яичные блюда - 1982.pdf", mt.name());
    }

    @Test
    public void testCreationDate() {
        Calendar cal = new GregorianCalendar(2021, Calendar.JUNE, 10, 15, 59, 24);
        Assert.assertEquals(cal.getTime(), mt.creationDate());
    }
}
@@ -32,72 +32,8 @@
 e;%0A%0A
-import java.util.Calendar;%0Aimport java.util.GregorianCalendar;%0A%0A
 impo
@@ -707,126 +707,29 @@
     
-Calendar cal = new GregorianCalendar(2021, Calendar.JUNE, 10, 15, 59, 24);%0A        Assert.assertEquals(cal.getTime(), 
+Assert.assertNotNull(
 mt.c

test fix