MicrometerRSocketInterceptor implements RSocketInterceptor { @Override public MicrometerRSocket apply(RSocket delegate) { Objects.requireNonNull(delegate, "delegate must not be null"); return new MicrometerRSocket(delegate, meterRegistry, tags); } MicrometerRSocketInterceptor(MeterRegistry meterRegistry, Tag... tags); @Override MicrometerRSocket apply(RSocket delegate);  }
@DisplayName("creates MicrometerRSocket") @Test void apply() { assertThat(new MicrometerRSocketInterceptor(meterRegistry).apply(delegate)) .isInstanceOf(MicrometerRSocket.class); }
@DisplayName("apply throws NullPointerException with null delegate") @Test void applyNullDelegate() { assertThatNullPointerException() .isThrownBy(() -> new MicrometerRSocketInterceptor(meterRegistry).apply(null)) .withMessage("delegate must not be null"); }