Skip to content

Commit

Permalink
Entry point assertion class for custom assertions
Browse files Browse the repository at this point in the history
Currently, `assertThat` methods from custom asserts(`SpanAssert`,
`SpansAssert`, `TracerAssert`) do not have an entry point assertion
class. Hence, users need to static import individual assert classes.

This change introduces an entry point assertion class. Users now simply
static import this class and all `assertThat` methods are available for
use.
  • Loading branch information
ttddyy committed Jun 28, 2022
1 parent 23cbae6 commit 465a091
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package io.micrometer.tracing.test.simple;

import java.util.Collection;

import io.micrometer.tracing.exporter.FinishedSpan;

/**
* Entry point assertions.
*
* @author Tadaya Tsuyukubo
* @since 1.0.0
*/
public class TracingAssertions {

@SuppressWarnings("rawtypes")
public static SpanAssert assertThat(FinishedSpan actual) {
return new SpanAssert(actual);
}

public static SpansAssert assertThat(Collection<FinishedSpan> actual) {
return new SpansAssert(actual);
}

public static TracerAssert assertThat(SimpleTracer actual) {
return new TracerAssert(actual);
}

}

0 comments on commit 465a091

Please sign in to comment.