@Test
  public void testInsert() throws IOException, InterruptedException {
    final String base = "http://localhost/rest";
    final String path = "/path/a/b/c";
    final String document = getN3Document();

    // Assertions
    resultEndpoint.allMessages().body().contains("update=INSERT DATA { ");
    resultEndpoint.allMessages().body().contains(" }");
    for (final String s : document.split("\n")) {
      resultEndpoint.expectedBodyReceived().body().contains(s);
    }
    resultEndpoint
        .expectedBodyReceived()
        .body()
        .contains("<" + base + path + "> dc:title \"some title\" .");
    resultEndpoint.expectedHeaderReceived("Content-Type", "application/x-www-form-urlencoded");
    resultEndpoint.expectedHeaderReceived(Exchange.HTTP_METHOD, "POST");

    // Test
    final Map<String, Object> headers = new HashMap<>();
    headers.put(FcrepoHeaders.FCREPO_BASE_URL, base);
    headers.put(FcrepoHeaders.FCREPO_IDENTIFIER, path);
    headers.put(Exchange.CONTENT_TYPE, "application/n-triples");
    template.sendBodyAndHeaders(document, headers);

    headers.clear();
    headers.put(JmsHeaders.BASE_URL, base);
    headers.put(JmsHeaders.IDENTIFIER, path);
    headers.put(Exchange.CONTENT_TYPE, "application/n-triples");
    template.sendBodyAndHeaders(document, headers);

    headers.clear();
    headers.put(JmsHeaders.BASE_URL, base);
    headers.put(FcrepoHeaders.FCREPO_IDENTIFIER, path);
    headers.put(Exchange.CONTENT_TYPE, "text/turtle");
    template.sendBodyAndHeaders(getTurtleDocument(), headers);

    headers.clear();
    headers.put(FcrepoHeaders.FCREPO_BASE_URL, base);
    headers.put(JmsHeaders.IDENTIFIER, path);
    headers.put(Exchange.CONTENT_TYPE, "application/n-triples");
    template.sendBodyAndHeaders(document, headers);

    // Confirm that assertions passed
    resultEndpoint.expectedMessageCount(4);
    resultEndpoint.assertIsSatisfied();
  }