Skip to content

Commit 141ed02

Browse files
committed
add comment and update signature
1 parent a469b33 commit 141ed02

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

web/src/test/java/com/microsoft/applicationinsights/web/internal/httputils/HttpServerHandlerTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void requestTelemetryFieldsAreSetWhenHandleStartIsInvoked() throws Malfor
148148
}
149149

150150
@Test
151-
public void timeStatusCodeAreSetWhenHandleEndIsInvoked() throws MalformedURLException {
151+
public void timeStatusCodeAreSetWhenHandleEndIsInvoked() throws Exception {
152152
RequestTelemetryContext rtc = httpServerHandler.handleStart(request, response);
153153
RequestTelemetry rt = rtc.getHttpRequestTelemetry();
154154
assertThat(rt.getId(), is(CoreMatchers.<String>notNullValue()));
@@ -157,11 +157,7 @@ public void timeStatusCodeAreSetWhenHandleEndIsInvoked() throws MalformedURLExce
157157
assertThat(rt.getUrl().toString(), equalTo(url));
158158
assertThat(rt.getContext().getUser().getUserAgent(), equalTo("User-Agent"));
159159
assertThat(rt.getTimestamp(), is(CoreMatchers.<Date>notNullValue()));
160-
try {
161-
TimeUnit.MILLISECONDS.sleep(100); // pause for a moment
162-
} catch (InterruptedException e) {
163-
Thread.currentThread().interrupt();
164-
}
160+
TimeUnit.MILLISECONDS.sleep(100); // pause so duration is nonzero
165161
httpServerHandler.handleEnd(request, response, rtc);
166162
// ensure same request telemetry is modified (picked from TLS)
167163
assertThat(rt.getDuration().getTotalMilliseconds(), is(not(0L)));

0 commit comments

Comments
 (0)