adjust scm client check and update unit test accordingly

This commit is contained in:
Konstantin Schaper
2020-10-30 12:20:45 +01:00
parent 00f2c3b7e8
commit 0beb749f23
2 changed files with 6 additions and 9 deletions

View File

@@ -91,15 +91,12 @@ class HttpProtocolServletTest {
@BeforeEach
void prepareMocks() {
when(userAgentParser.parse(request)).thenReturn(userAgent);
when(userAgent.isBrowser()).thenReturn(true);
when(userAgent.isScmClient()).thenReturn(false);
when(request.getRequestURI()).thenReturn("uri");
}
@Test
void shouldDispatchBrowserRequests() throws ServletException, IOException {
when(userAgent.isBrowser()).thenReturn(true);
when(request.getRequestURI()).thenReturn("uri");
servlet.service(request, response);
verify(dispatcher).dispatch(request, response, "uri");
@@ -113,7 +110,7 @@ class HttpProtocolServletTest {
@BeforeEach
void prepareMocks() {
when(userAgentParser.parse(request)).thenReturn(userAgent);
when(userAgent.isBrowser()).thenReturn(false);
when(userAgent.isScmClient()).thenReturn(true);
}
@Test