### Question:
ElasticSearchSerializerWithMapping implements
		ElasticSearchIndexRequestBuilderFactory { @Override public void configure(Context context) { String mappingFile = context.getString(CONF_MAPPING_FILE); try { jsonMapping = readFile(new File(mappingFile)); } catch (IOException e) { Throwables.propagate(e); } }  @Override void configure(Context context); @Override void configure(ComponentConfiguration conf); @Override IndexRequestBuilder createIndexRequest(Client client,
			String indexPrefix, String indexType, Event event);  }### Answer:
@Test(expected = NullPointerException.class) public void badFileTest() throws IOException { URL resourceUrl = getClass().getResource(MAPPING_PATH); Context context = new Context(); context.put("mappingFile2", resourceUrl.getPath()); serializer = new ElasticSearchSerializerWithMapping(); serializer.configure(context); }
@Test public void goodFileTest() throws IOException { URL resourceUrl = getClass().getResource(MAPPING_PATH); Context context = new Context(); context.put("mappingFile", resourceUrl.getPath()); serializer = new ElasticSearchSerializerWithMapping(); serializer.configure(context); Assert.assertNotNull(serializer); }