Tabnine Logo
SpanTest.createFilledOutSpan
Code IndexAdd Tabnine to your IDE (free)

How to use
createFilledOutSpan
method
in
com.nike.wingtips.SpanTest

Best Java code snippets using com.nike.wingtips.SpanTest.createFilledOutSpan (Showing top 18 results out of 315)

origin: Nike-Inc/wingtips

@Test
public void equals_returns_true_and_hashCode_same_if_all_fields_are_equal() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  // expect
  assertThat(fullSpan1.equals(fullSpan2)).isTrue();
  assertThat(fullSpan1.hashCode()).isEqualTo(fullSpan2.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_tags_are_different() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  fullSpan1.putTag("key-" + UUID.randomUUID().toString(), UUID.randomUUID().toString());
  // expect
  assertThat(fullSpan1.equals(fullSpan2)).isFalse();
  assertThat(fullSpan1.hashCode()).isNotEqualTo(fullSpan2.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_other_is_not_a_Span() {
  // given
  Span span = createFilledOutSpan(true);
  String notASpan = "notASpan";
  // expect
  //noinspection EqualsBetweenInconvertibleTypes
  assertThat(span.equals(notASpan)).isFalse();
  assertThat(span.hashCode()).isNotEqualTo(notASpan.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void toString_delegates_to_toJSON() {
  // given: span with all values filled in
  Span span = createFilledOutSpan(true);
  // when: toString is called on that span
  String toStringVal = span.toString();
  // then: it has the same value as toJSON()
  assertThat(toStringVal).isEqualTo(span.toJSON());
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_true_and_hashCode_same_if_same_instance() {
  // given
  Span fullSpan = createFilledOutSpan(true);
  // expect
  //noinspection EqualsWithItself
  assertThat(fullSpan.equals(fullSpan)).isTrue();
  assertThat(fullSpan.hashCode()).isEqualTo(fullSpan.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_spanName_is_different() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  Whitebox.setInternalState(fullSpan2, "spanName", fullSpan1.getSpanName() + "_nope");
  // expect
  assertThat(fullSpan1.equals(fullSpan2)).isFalse();
  assertThat(fullSpan1.hashCode()).isNotEqualTo(fullSpan2.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_parentSpanId_is_different() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  List<String> badDataList = Arrays.asList(fullSpan1.getParentSpanId() + "_nope", null);
  for (String badData : badDataList) {
    Whitebox.setInternalState(fullSpan2, "parentSpanId", badData);
    // expect
    assertThat(fullSpan1.equals(fullSpan2)).isFalse();
    assertThat(fullSpan2.equals(fullSpan1)).isFalse();
    assertThat(fullSpan1.hashCode()).isNotEqualTo(fullSpan2.hashCode());
  }
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_spanId_is_different() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  Whitebox.setInternalState(fullSpan2, "spanId", fullSpan1.getSpanId() + "_nope");
  // expect
  assertThat(fullSpan1.equals(fullSpan2)).isFalse();
  assertThat(fullSpan1.hashCode()).isNotEqualTo(fullSpan2.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_traceId_is_different() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  Whitebox.setInternalState(fullSpan2, "traceId", fullSpan1.getTraceId() + "_nope");
  // expect
  assertThat(fullSpan1.equals(fullSpan2)).isFalse();
  assertThat(fullSpan1.hashCode()).isNotEqualTo(fullSpan2.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_userId_is_different() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  List<String> badDataList = Arrays.asList(fullSpan1.getUserId() + "_nope", null);
  for (String badData : badDataList) {
    Whitebox.setInternalState(fullSpan2, "userId", badData);
    // expect
    assertThat(fullSpan1.equals(fullSpan2)).isFalse();
    assertThat(fullSpan2.equals(fullSpan1)).isFalse();
    assertThat(fullSpan1.hashCode()).isNotEqualTo(fullSpan2.hashCode());
  }
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_spanStartTimeEpochMicros_is_different() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  Whitebox.setInternalState(fullSpan2, "spanStartTimeEpochMicros", fullSpan1.getSpanStartTimeEpochMicros() + 1);
  // expect
  assertThat(fullSpan1.equals(fullSpan2)).isFalse();
  assertThat(fullSpan1.hashCode()).isNotEqualTo(fullSpan2.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_annotations_are_different() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  fullSpan1.addTimestampedAnnotation(TimestampedAnnotation.forCurrentTime("foo"));
  // expect
  assertThat(fullSpan1.equals(fullSpan2)).isFalse();
  assertThat(fullSpan1.hashCode()).isNotEqualTo(fullSpan2.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_sampleable_is_different() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  Whitebox.setInternalState(fullSpan2, "sampleable", !fullSpan1.isSampleable());
  // expect
  assertThat(fullSpan1.equals(fullSpan2)).isFalse();
  assertThat(fullSpan1.hashCode()).isNotEqualTo(fullSpan2.hashCode());
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_durationNanos_is_different() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  List<Long> badDataList = Arrays.asList(fullSpan1.getDurationNanos() + 1, null);
  for (Long badData : badDataList) {
    Whitebox.setInternalState(fullSpan2, "durationNanos", badData);
    // expect
    assertThat(fullSpan1.equals(fullSpan2)).isFalse();
    assertThat(fullSpan2.equals(fullSpan1)).isFalse();
    assertThat(fullSpan1.hashCode()).isNotEqualTo(fullSpan2.hashCode());
  }
}
origin: Nike-Inc/wingtips

@Test
public void equals_returns_false_and_hashCode_different_if_spanPurpose_is_different() {
  // given
  Span fullSpan1 = createFilledOutSpan(true);
  Span fullSpan2 = createFilledOutSpan(true);
  List<SpanPurpose> badDataList = Arrays.asList(SpanPurpose.CLIENT, SpanPurpose.UNKNOWN, null);
  for (SpanPurpose badData : badDataList) {
    assertThat(fullSpan1.getSpanPurpose()).isNotEqualTo(badData);
    Whitebox.setInternalState(fullSpan2, "spanPurpose", badData);
    // expect
    assertThat(fullSpan1.equals(fullSpan2)).isFalse();
    assertThat(fullSpan2.equals(fullSpan1)).isFalse();
    assertThat(fullSpan1.hashCode()).isNotEqualTo(fullSpan2.hashCode());
  }
}
origin: Nike-Inc/wingtips

public void generateChildSpan_works_as_expected_for_incomplete_parent_span(SpanPurpose childSpanPurpose) {
  Span parentSpan = createFilledOutSpan(false);
  String childSpanName = UUID.randomUUID().toString();
  assertThat(parentSpan.isCompleted()).isFalse();
origin: Nike-Inc/wingtips

public void generateChildSpan_works_as_expected_for_completed_parent_span(SpanPurpose childSpanPurpose) {
  Span parentSpan = createFilledOutSpan(true);
  String childSpanName = UUID.randomUUID().toString();
  assertThat(parentSpan.isCompleted()).isTrue();
origin: Nike-Inc/wingtips

@DataProvider(value = {
  "SERVER",
  "CLIENT",
  "LOCAL_ONLY",
  "UNKNOWN"
}, splitBy = "\\|")
@Test
public void newBuilder_with_copy_arg_returns_exact_copy(SpanPurpose spanPurpose) {
  // given
  Span origSpan = createFilledOutSpan(true);
  Whitebox.setInternalState(origSpan, "spanPurpose", spanPurpose);
  assertThat(origSpan.getSpanPurpose()).isEqualTo(spanPurpose);
  // when
  Span copySpan = Span.newBuilder(origSpan).build();
  // then
  verifySpanDeepEquals(copySpan, origSpan, false);
}
com.nike.wingtipsSpanTestcreateFilledOutSpan

Popular methods of SpanTest

  • busyWaitForNanos
  • calculateNanoStartTimeFromSpecifiedEpochMicrosStartTime
  • nullSafeStringValueOf
  • resetTracing
  • verifySpanDeepEquals
  • verifySpanEqualsDeserializedValues

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now