@Override
    public Messages process(Messages messages) {
        try (Timer.Context ignored = executionTime.time()) {
            final State latestState = stateUpdater.getLatestState();
            if (latestState.enableRuleMetrics()) {
                return process(messages, new RuleMetricsListener(metricRegistry), latestState);
            }
            return process(messages, new NoopInterpreterListener(), latestState);
        }
    }
@Test
    public void process_noEvaluationErrorsResultIntoNoMessageProcessingErrors() {
        // given
        when(ruleService.loadAll()).thenReturn(ImmutableList.of(RuleDao.create("valid_rule", "valid_rule",
                "valid_rule",
                "rule \"valid_rule\"\n" +
                        "when\n" +
                        "    has_field(\"num\")\n" +
                        "then\n" +
                        "    set_field(\"num_sqr\", to_double($message.num) * to_double($message.num));\n" +
                        "end", null, null, null, null)));

        when(pipelineService.loadAll()).thenReturn(Collections.singleton(
                PipelineDao.create("p1", "title", "description",
                        "pipeline \"pipeline\"\n" +
                                "stage 0 match all\n" +
                                "    rule \"valid_rule\";\n" +
                                "end\n",
                        Tools.nowUTC(),
                        null)
        ));


        final PipelineInterpreter interpreter = createPipelineInterpreter(ruleService, pipelineService, ImmutableMap.of(
                SetField.NAME, new SetField(),
                DoubleConversion.NAME, new DoubleConversion(),
                HasField.NAME, new HasField()
        ));

        // when
        final List<Message> processed = extractMessagesFromMessageCollection(interpreter.process(messageWithNumField(Long.valueOf(5))));

        // then
        assertThat(processed)
                .hasSize(1)
                .hasOnlyOneElementSatisfying(m -> {
                    assertThat(m.processingErrors()).isEmpty();
                    assertThat(m.getField("num_sqr")).isEqualTo(Double.valueOf(25.0));
                });
    }