@Test(expected = ElasticsearchException.class)
public void testOverwrite() throws Exception {

    MockProcessor processor = new MockProcessor(new RosetteApiWrapper(), randomUnicodeOfLength(10),
            "description", "text", "target");
    //Process document with a value already in the target field
    Map<String, Object> document = new HashMap<>();
    document.put("text", "input text");
    document.put("target", "don't overwrite me!");
    IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document);
    //We expect an exception to be thrown
    processor.execute(ingestDocument);
}