Пример #1
0
  @Test
  public void testGetPersistedFields() throws Exception {
    final TestExtractor extractor =
        new TestExtractor.Builder().conditionType(REGEX).conditionValue("^hello").build();

    final Map<String, Object> persistedFields =
        ImmutableMap.<String, Object>builder()
            .put("id", "test-id")
            .put("title", "test-title")
            .put("order", 0L)
            .put("type", "regex")
            .put("cursor_strategy", "copy")
            .put("target_field", "target")
            .put("source_field", "message")
            .put("creator_user_id", "user")
            .put("extractor_config", Collections.<String, Object>emptyMap())
            .put("condition_type", "regex")
            .put("condition_value", "^hello")
            .put("converters", Collections.<Converter>emptyList())
            .build();

    assertThat(extractor.getPersistedFields()).isEqualTo(persistedFields);
  }