### Question:
SolrUpdateProcessor implements Processor { @Override public void process(Exchange exchange) throws Exception { log.debug("Processing solr update"); final Message in = exchange.getIn(); Document msgBody = MessageUtil.getDocumentBody(in); Element body = msgBody.getRootElement(); String pid = body.getChild("pid", ATOM_NS).getTextTrim(); String action = body.getChild("actionType", ATOM_NS).getTextTrim(); IndexingActionType actionType = IndexingActionType.getAction(action); List<String> children = extractChildren(body); Map<String, String> params = extractParams(body); Element authorEl = body.getChild("author", ATOM_NS); String author = null; if (authorEl != null) { author = authorEl.getChildText("name", ATOM_NS); } SolrUpdateRequest updateRequest; if (children == null) { updateRequest = new SolrUpdateRequest(pid, actionType, null, author); } else { updateRequest = new ChildSetRequest(pid, children, actionType, author); } updateRequest.setParams(params); IndexingAction indexingAction = this.solrIndexingActionMap.get(actionType); if (indexingAction != null) { log.info("Performing action {} on object {}", action, pid); indexingAction.performAction(updateRequest); } }  @Override void process(Exchange exchange); void setSolrIndexingActionMap(Map<IndexingActionType, IndexingAction> solrIndexingActionMap);  }### Answer:
@Test public void testMessageNoChildren() throws Exception { populateEntry(ADD); processor.process(exchange); verify(mockAddAction).performAction(any(SolrUpdateRequest.class)); }
@Test public void testMessageWithChildren() throws Exception { populateEntry(ADD); List<PID> childrenPaths = addChildren(3); processor.process(exchange); verify(mockAddAction).performAction(childSetCaptor.capture()); ChildSetRequest childSetRequest = childSetCaptor.getValue(); assertTrue(childSetRequest.getChildren().containsAll(childrenPaths)); }
@Test public void testInvalidIndexingAction() throws Exception { populateEntry(DELETE); processor.process(exchange); verify(mockAddAction, never()).performAction(any()); }