summaryrefslogtreecommitdiff
path: root/src/test/java/org/zwobble/mammoth/tests/docx/RelationshipsTests.java
blob: f9a767289cec954b29445d7330670f481d72af81 (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.MammothMaps.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());
    }
}