summaryrefslogtreecommitdiff
path: root/src/test/java/org/zwobble/mammoth/tests/docx/RelationshipsTests.java
blob: a8300dfb5f2f6d06860c62e3a3912db3e050da5c (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.Test;
import org.zwobble.mammoth.internal.docx.Relationships;

import static org.junit.Assert.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());
    }
}