@Test public void happyPath() throws IOException { int status = 200; proxy.onResponseStatus("version", status, "reason"); verifyZeroInteractions(spanStore); assertThat(proxy.getStatus(), is(status)); } }
@Test public void happyPath() throws IOException { int status = 200; proxy.onResponseStatus("version", status, "reason"); // can not be called before status reporting proxy.onResponseComplete(); ArgumentCaptor<TagsProvidingAdapter> captor = ArgumentCaptor.forClass(TagsProvidingAdapter.class); verify(spanStore).finishSpan(captor.capture()); TagsProvidingAdapter adapter = captor.getValue(); assertThat(adapter, is(instanceOf(HttpResponseAdapter.class))); assertThat(adapter.getTags(), hasEntry(Tags.HTTP_STATUS.getKey(), String.valueOf(status))); } }