aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/zwobble/mammoth/tests/docx/RelationshipsTests.java
blob: c860ba13dd7bfa1f4235bfb64db0d5fcd6e90d14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package org.zwobble.mammoth.tests.docx;

import org.junit.jupiter.api.Test;
import org.zwobble.mammoth.internal.docx.Relationships;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.zwobble.mammoth.internal.util.Maps.map;
import static org.zwobble.mammoth.tests.util.MammothAsserts.assertThrows;

public class RelationshipsTests {
    @Test
    public void exceptionIsThrownIfRelationshipCannotBeFound() {
        Relationships relationships = new Relationships(map());
        RuntimeException exception = assertThrows(
            RuntimeException.class,
            () -> relationships.findRelationshipById("rId5"));
        assertEquals("Could not find relationship 'rId5'", exception.getMessage());
    }
}