@@ -103,7 +103,8 @@ public void testExecuteItem() throws Exception {
103
103
104
104
public void testExecuteVerboseItemExceptionWithoutOnFailure () throws Exception {
105
105
TestProcessor processor1 = new TestProcessor ("processor_0" , "mock" , ingestDocument -> {});
106
- TestProcessor processor2 = new TestProcessor ("processor_1" , "mock" , ingestDocument -> { throw new RuntimeException ("processor failed" ); });
106
+ TestProcessor processor2 = new TestProcessor ("processor_1" , "mock" ,
107
+ ingestDocument -> { throw new RuntimeException ("processor failed" ); });
107
108
TestProcessor processor3 = new TestProcessor ("processor_2" , "mock" , ingestDocument -> {});
108
109
Pipeline pipeline = new Pipeline ("_id" , "_description" , version , new CompoundProcessor (processor1 , processor2 , processor3 ));
109
110
SimulateDocumentResult actualItemResponse = executionService .executeDocument (pipeline , ingestDocument , true );
@@ -117,7 +118,8 @@ public void testExecuteVerboseItemExceptionWithoutOnFailure() throws Exception {
117
118
assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getFailure (), nullValue ());
118
119
assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument (), not (sameInstance (ingestDocument )));
119
120
assertIngestDocument (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument (), ingestDocument );
120
- assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument ().getSourceAndMetadata (), not (sameInstance (ingestDocument .getSourceAndMetadata ())));
121
+ assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument ().getSourceAndMetadata (),
122
+ not (sameInstance (ingestDocument .getSourceAndMetadata ())));
121
123
assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (1 ).getProcessorTag (), equalTo ("processor_1" ));
122
124
assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (1 ).getIngestDocument (), nullValue ());
123
125
assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (1 ).getFailure (), instanceOf (RuntimeException .class ));
@@ -126,7 +128,8 @@ public void testExecuteVerboseItemExceptionWithoutOnFailure() throws Exception {
126
128
}
127
129
128
130
public void testExecuteVerboseItemWithOnFailure () throws Exception {
129
- TestProcessor processor1 = new TestProcessor ("processor_0" , "mock" , ingestDocument -> { throw new RuntimeException ("processor failed" ); });
131
+ TestProcessor processor1 = new TestProcessor ("processor_0" , "mock" ,
132
+ ingestDocument -> { throw new RuntimeException ("processor failed" ); });
130
133
TestProcessor processor2 = new TestProcessor ("processor_1" , "mock" , ingestDocument -> {});
131
134
TestProcessor processor3 = new TestProcessor ("processor_2" , "mock" , ingestDocument -> {});
132
135
Pipeline pipeline = new Pipeline ("_id" , "_description" , version ,
@@ -151,7 +154,8 @@ public void testExecuteVerboseItemWithOnFailure() throws Exception {
151
154
metadata .put (CompoundProcessor .ON_FAILURE_PROCESSOR_TYPE_FIELD , "mock" );
152
155
metadata .put (CompoundProcessor .ON_FAILURE_PROCESSOR_TAG_FIELD , "processor_0" );
153
156
metadata .put (CompoundProcessor .ON_FAILURE_MESSAGE_FIELD , "processor failed" );
154
- assertIngestDocument (simulateDocumentVerboseResult .getProcessorResults ().get (1 ).getIngestDocument (), ingestDocumentWithOnFailureMetadata );
157
+ assertIngestDocument (simulateDocumentVerboseResult .getProcessorResults ().get (1 ).getIngestDocument (),
158
+ ingestDocumentWithOnFailureMetadata );
155
159
156
160
assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (1 ).getFailure (), nullValue ());
157
161
@@ -175,7 +179,8 @@ public void testExecuteVerboseItemExceptionWithIgnoreFailure() throws Exception
175
179
assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getFailure (), sameInstance (exception ));
176
180
assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument (), not (sameInstance (ingestDocument )));
177
181
assertIngestDocument (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument (), ingestDocument );
178
- assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument ().getSourceAndMetadata (), not (sameInstance (ingestDocument .getSourceAndMetadata ())));
182
+ assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument ().getSourceAndMetadata (),
183
+ not (sameInstance (ingestDocument .getSourceAndMetadata ())));
179
184
}
180
185
181
186
public void testExecuteVerboseItemWithoutExceptionAndWithIgnoreFailure () throws Exception {
@@ -191,7 +196,8 @@ public void testExecuteVerboseItemWithoutExceptionAndWithIgnoreFailure() throws
191
196
assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getFailure (), nullValue ());
192
197
assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument (), not (sameInstance (ingestDocument )));
193
198
assertIngestDocument (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument (), ingestDocument );
194
- assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument ().getSourceAndMetadata (), not (sameInstance (ingestDocument .getSourceAndMetadata ())));
199
+ assertThat (simulateDocumentVerboseResult .getProcessorResults ().get (0 ).getIngestDocument ().getSourceAndMetadata (),
200
+ not (sameInstance (ingestDocument .getSourceAndMetadata ())));
195
201
}
196
202
197
203
public void testExecuteItemWithFailure () throws Exception {
0 commit comments