aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/pacien/pandoc/filter/plantuml/FilterTest.java
blob: f720b22bcc78c2e7ba8a14749a1d95dcd2859b93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package org.pacien.pandoc.filter.plantuml;

import org.junit.Assert;
import org.junit.Test;

import java.io.*;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;

final public class FilterTest {

  private static final String INPUT_FILE = "/input.json";
  private static final String EXPECTED_FILE = "/expected.json";

  @Test
  public void filterTest() {
    try (ByteArrayOutputStream o = new ByteArrayOutputStream()) {
      byte[] e = Files.readAllBytes(Paths.get(getClass().getResource(EXPECTED_FILE).toURI()));
      Filter.filter(getClass().getResourceAsStream(INPUT_FILE), o);
      Assert.assertArrayEquals(o.toByteArray(), e);
    } catch (IOException | URISyntaxException e) {
      Assert.fail();
    }
  }

}