MetricsMailet extends GenericMailet { @Override public void init() throws MessagingException { String metricName = getInitParameter(METRIC_NAME); init(metricName); } @Inject  MetricsMailet(MetricFactory metricFactory); @Override void init(); @Override void service(Mail mail); @Override String getMailetInfo(); static final String METRIC_NAME; }
@Test void initShouldThrowWhenMetricNameIsNotGiven() { assertThatThrownBy(() -> mailet.init(FakeMailetConfig.builder().mailetName(MAILET_NAME).build())) .isInstanceOf(NullPointerException.class); }