public class RegexExtractorTest extends AbstractExtractorTest {
@Test
public void testBasicExtraction() throws Exception {
Message msg = new Message("The short message", "TestUnit", Tools.iso8601());
msg.addField("somefield", "<10> 07 Aug 2013 somesubsystem: this is my message for username9001 id:9001");
RegexExtractor x = new RegexExtractor(metricRegistry, "foo", "foo", 0, Extractor.CursorStrategy.COPY, "somefield", "our_result", config("id:(\\d+)"), "foo", noConverters(), Extractor.ConditionType.NONE, null);
x.runExtractor(msg);
assertNotNull(msg.getField("our_result"));