@Test(expected = IllegalStateException.class) public void buildZipkinData_WhenZipkinDataAlreadyExists_ShouldThrowISE() { String spanName = "Span Name"; when(zipkinDataBuilder.spanName(spanName)).thenReturn(zipkinDataBuilder); when(zipkinDataBuilder.build()).thenReturn(zipkinData); victim = new ZipkinRequestUUIDImpl(cougarUuid, zipkinDataBuilder); victim.buildZipkinData(spanName); victim.buildZipkinData(spanName); }
@Override public ZipkinData buildZipkinData(@Nonnull String spanName) { Objects.requireNonNull(spanName); if (zipkinData == null) { zipkinData = zipkinDataBuilder.spanName(spanName).build(); return zipkinData; } else { throw new IllegalStateException("Span name was already set for this request."); } }
ZipkinRequestUUIDImpl implements ZipkinRequestUUID { @Override public ZipkinData buildZipkinData(@Nonnull String spanName) { Objects.requireNonNull(spanName); if (zipkinData == null) { zipkinData = zipkinDataBuilder.spanName(spanName).build(); return zipkinData; } else { throw new IllegalStateException("Span name was already set for this request."); } } }
ZipkinRequestUUIDImpl implements ZipkinRequestUUID { @Override public ZipkinData buildZipkinData(@Nonnull String spanName) { Objects.requireNonNull(spanName); if (zipkinData == null) { zipkinData = zipkinDataBuilder.spanName(spanName).build(); return zipkinData; } else { throw new IllegalStateException("Span name was already set for this request."); } } ZipkinRequestUUIDImpl(@Nonnull RequestUUID cougarUuid);  ZipkinRequestUUIDImpl(@Nonnull RequestUUID cougarUuid, @Nullable ZipkinDataBuilder zipkinDataBuilder); }
ZipkinRequestUUIDImpl implements ZipkinRequestUUID { @Override public ZipkinData buildZipkinData(@Nonnull String spanName) { Objects.requireNonNull(spanName); if (zipkinData == null) { zipkinData = zipkinDataBuilder.spanName(spanName).build(); return zipkinData; } else { throw new IllegalStateException("Span name was already set for this request."); } } ZipkinRequestUUIDImpl(@Nonnull RequestUUID cougarUuid);  ZipkinRequestUUIDImpl(@Nonnull RequestUUID cougarUuid, @Nullable ZipkinDataBuilder zipkinDataBuilder); @Override String getRootUUIDComponent(); @Override String getParentUUIDComponent(); @Override String getLocalUUIDComponent(); @Override @Nonnull RequestUUID getNewSubUUID(); @Override @Nonnull ZipkinData getZipkinData(); @Override boolean isZipkinTracingEnabled(); @Override boolean isZipkinTracingReady(); @Override ZipkinData buildZipkinData(@Nonnull String spanName); @Override String getUUID(); @Override String toCougarLogString(); @Override String toString(); }
ZipkinRequestUUIDImpl implements ZipkinRequestUUID { @Override public ZipkinData buildZipkinData(@Nonnull String spanName) { Objects.requireNonNull(spanName); if (zipkinData == null) { zipkinData = zipkinDataBuilder.spanName(spanName).build(); return zipkinData; } else { throw new IllegalStateException("Span name was already set for this request."); } } ZipkinRequestUUIDImpl(@Nonnull RequestUUID cougarUuid);  ZipkinRequestUUIDImpl(@Nonnull RequestUUID cougarUuid, @Nullable ZipkinDataBuilder zipkinDataBuilder); @Override String getRootUUIDComponent(); @Override String getParentUUIDComponent(); @Override String getLocalUUIDComponent(); @Override @Nonnull RequestUUID getNewSubUUID(); @Override @Nonnull ZipkinData getZipkinData(); @Override boolean isZipkinTracingEnabled(); @Override boolean isZipkinTracingReady(); @Override ZipkinData buildZipkinData(@Nonnull String spanName); @Override String getUUID(); @Override String toCougarLogString(); @Override String toString();  }