OperationWrapperOptions { public static <T> Builder<T> newBuilder(@NotNull String operationSpanName, @NotNull SpanPurpose spanPurpose) { return new Builder<>(operationSpanName, spanPurpose); } OperationWrapperOptions(@NotNull Builder<T> builder); static Builder<T> newBuilder(@NotNull String operationSpanName, @NotNull SpanPurpose spanPurpose); final @NotNull String operationSpanName; final @NotNull SpanPurpose spanPurpose; final @Nullable TracingState parentTracingState; final @Nullable SpanTagger<T> spanTagger; final @Nullable ErrorSpanTagger errorTagger; }
@UseDataProvider("spanPurposeDataProvider") @Test public void newBuilder_works_as_expected(SpanPurpose spanPurpose) { String spanName = UUID.randomUUID().toString(); Builder<?> builder = OperationWrapperOptions.newBuilder(spanName, spanPurpose); assertThat(builder.operationSpanName).isEqualTo(spanName); assertThat(builder.spanPurpose).isEqualTo(spanPurpose); assertThat(builder.parentTracingState).isNull(); assertThat(builder.spanTagger).isNull(); assertThat(builder.errorTagger).isEqualTo(ErrorSpanTagger.DEFAULT_IMPL); }