File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
web/src/test/java/com/microsoft/applicationinsights/web/internal/httputils Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff 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 )));
You can’t perform that action at this time.
0 commit comments