mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-21 15:02:17 +01:00
Fix unnecessary stubbing
This commit is contained in:
@@ -3,12 +3,12 @@ package sonia.scm.web;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.mockito.Mockito.*;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
public class WireProtocolRequestMockFactory {
|
||||
|
||||
@@ -88,7 +88,6 @@ public class WireProtocolRequestMockFactory {
|
||||
private HttpServletRequest base(String method, String queryStringValue) {
|
||||
HttpServletRequest request = mock(HttpServletRequest.class);
|
||||
|
||||
when(request.getRequestURI()).thenReturn(repositoryPath);
|
||||
when(request.getMethod()).thenReturn(method);
|
||||
|
||||
queryString(request, queryStringValue);
|
||||
|
||||
@@ -47,7 +47,10 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
@@ -98,7 +101,6 @@ public class WireProtocolTest {
|
||||
|
||||
@Test
|
||||
public void testGetCommandsOfWithHgArgsPost() throws IOException {
|
||||
when(request.getMethod()).thenReturn("POST");
|
||||
when(request.getQueryString()).thenReturn("cmd=batch");
|
||||
when(request.getIntHeader("X-HgArgs-Post")).thenReturn(29);
|
||||
when(request.getHeaderNames()).thenReturn(Collections.enumeration(Lists.newArrayList("X-HgArgs-Post")));
|
||||
|
||||
Reference in New Issue
Block a user