package dashboard.filter;

import dashboard.manage.Manage;
import org.junit.Test;
import org.springframework.http.HttpMethod;
import org.springframework.mock.web.MockFilterChain;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

import javax.servlet.ServletException;
import java.io.IOException;

import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;

public class EnsureAccessToIdpFilterTest {

    private EnsureAccessToIdpFilter subject = new EnsureAccessToIdpFilter(mock(Manage.class));

    @Test
    public void doFilter() throws IOException, ServletException {
        subject.doFilter(new MockHttpServletRequest("GET","/dashboard/api"), new MockHttpServletResponse(), new MockFilterChain());
    }
}
@@ -427,65 +427,245 @@
 to.M
-ockito.mock;%0A%0Apublic class EnsureAccessToIdpFilterTest %7B%0A
+atchers.anyBoolean;%0Aimport static org.mockito.Matchers.anyString;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class EnsureAccessToIdpFilterTest %7B%0A    private Manage manage = mock(Manage.class);
 %0A   
@@ -736,33 +736,21 @@
 Filter(m
-ock(Manage.class)
+anage
 );%0A%0A    
@@ -821,16 +821,182 @@
 ption %7B%0A
+        when(manage.getIdentityProvider(anyString(), anyBoolean())).thenThrow(new IllegalArgumentException());%0A        MockFilterChain chain = new MockFilterChain();%0A
         
@@ -1045,16 +1045,17 @@
 t(%22GET%22,
+ 
 %22/dashbo
@@ -1096,35 +1096,62 @@
 onse(), 
-new MockFilterChain
+chain);%0A        assertNotNull(chain.getRequest
 ());%0A   

Assert non-null