public static SmartFilterTestExecutionResultDTO execSmartFilterTest(SmartFilterTestExecutionDTO execData) {
    Predicate<TopicMessageDTO> predicate;
    try {
      predicate = MessageFilters.createMsgFilter(
          execData.getFilterCode(),
          MessageFilterTypeDTO.GROOVY_SCRIPT
      );
    } catch (Exception e) {
      log.info("Smart filter '{}' compilation error", execData.getFilterCode(), e);
      return new SmartFilterTestExecutionResultDTO()
          .error("Compilation error : " + e.getMessage());
    }
    try {
      var result = predicate.test(
          new TopicMessageDTO()
              .key(execData.getKey())
              .content(execData.getValue())
              .headers(execData.getHeaders())
              .offset(execData.getOffset())
              .partition(execData.getPartition())
              .timestamp(
                  Optional.ofNullable(execData.getTimestampMs())
                      .map(ts -> OffsetDateTime.ofInstant(Instant.ofEpochMilli(ts), ZoneOffset.UTC))
                      .orElse(null))
      );
      return new SmartFilterTestExecutionResultDTO()
          .result(result);
    } catch (Exception e) {
      log.info("Smart filter {} execution error", execData, e);
      return new SmartFilterTestExecutionResultDTO()
          .error("Execution error : " + e.getMessage());
    }
  }
@Test
  void execSmartFilterTestReturnsExecutionResult() {
    var params = new SmartFilterTestExecutionDTO()
        .filterCode("key != null && value != null && headers != null && timestampMs != null && offset != null")
        .key("1234")
        .value("{ \"some\" : \"value\" } ")
        .headers(Map.of("h1", "hv1"))
        .offset(12345L)
        .timestampMs(System.currentTimeMillis())
        .partition(1);
    assertThat(execSmartFilterTest(params).getResult()).isTrue();

    params.setFilterCode("return false");
    assertThat(execSmartFilterTest(params).getResult()).isFalse();
  }