### Question:
IndexerRestService extends RestServiceBase { protected IndexerHandler getIndexerHandler(String indexerType, String contentType) throws ObjectNotFoundException { indexerType = SearchUtils.trimToNull(indexerType); if (indexerType == null) { throw new ObjectNotFoundException("Indexer type is not configured correctly for content type " + contentType); } if (INDEXER_TYPE_ES_RIVER_REMOTE.equals(indexerType)) { return esRiverRemoteIndexerHandler; } else if (INDEXER_TYPE_ES_RIVER_JIRA.equals(indexerType)) { return esRiverJiraIndexerHandler; } else { throw new ObjectNotFoundException("Unsupported indexer type '" + indexerType + "' configured for content type " + contentType); } }  @POST @Path("/{type}/_force_reindex") Response forceReindex(@PathParam("type") @AuditId String type); @POST @Path("/_all/_stop") Map<String, String> stopAll(); @POST @Path("/{type}/_stop") Response stop(@PathParam("type") @AuditId String type); @POST @Path("/_all/_restart") Map<String, String> restartAll(); @POST @Path("/{type}/_restart") Response restart(@PathParam("type") @AuditId String type); @GET @Path("/_all/_status") @AuditIgnore Map<String, Object> statusAll(); @GET @Path("/{type}/_status") @AuditIgnore Object getStatus(@PathParam("type") String type); static final String INDEXER_TYPE_ES_RIVER_REMOTE; static final String INDEXER_TYPE_ES_RIVER_JIRA; }### Answer:
@Test public void getIndexerHandler() throws ObjectNotFoundException { IndexerRestService tested = getTested(); try { tested.getIndexerHandler(null, "ct"); Assert.fail("ObjectNotFoundException expected"); } catch (ObjectNotFoundException e) { } try { tested.getIndexerHandler("", "ct"); Assert.fail("ObjectNotFoundException expected"); } catch (ObjectNotFoundException e) { } try { tested.getIndexerHandler("unknown_indexer_type", "ct"); Assert.fail("ObjectNotFoundException expected"); } catch (ObjectNotFoundException e) { } Assert.assertEquals(tested.esRiverJiraIndexerHandler, tested.getIndexerHandler(IndexerRestService.INDEXER_TYPE_ES_RIVER_JIRA, "ct")); Assert.assertEquals(tested.esRiverRemoteIndexerHandler, tested.getIndexerHandler(IndexerRestService.INDEXER_TYPE_ES_RIVER_REMOTE, "ct")); }