Search in sources :

Example 1 with Platform

use of org.sonar.server.platform.Platform in project sonarqube by SonarSource.

the class RequestIdFilterTest method filter_does_not_add_requestId_to_request_passed_on_to_chain_when_there_is_no_RequestIdGenerator_in_container.

@Test
public void filter_does_not_add_requestId_to_request_passed_on_to_chain_when_there_is_no_RequestIdGenerator_in_container() throws IOException, ServletException {
    Platform platform = mock(Platform.class);
    when(platform.getContainer()).thenReturn(new ComponentContainer());
    RequestIdFilter underTest = new RequestIdFilter(platform);
    underTest.doFilter(servletRequest, servletResponse, filterChain);
    verify(servletRequest, times(0)).setAttribute(anyString(), anyString());
}
Also used : Platform(org.sonar.server.platform.Platform) ComponentContainer(org.sonar.core.platform.ComponentContainer) Test(org.junit.Test)

Example 2 with Platform

use of org.sonar.server.platform.Platform in project sonarqube by SonarSource.

the class RequestIdFilterTest method filter_does_not_fail_when_there_is_no_RequestIdGenerator_in_container.

@Test
public void filter_does_not_fail_when_there_is_no_RequestIdGenerator_in_container() throws IOException, ServletException {
    Platform platform = mock(Platform.class);
    when(platform.getContainer()).thenReturn(new ComponentContainer());
    RequestIdFilter underTest = new RequestIdFilter(platform);
    underTest.doFilter(servletRequest, servletResponse, filterChain);
}
Also used : Platform(org.sonar.server.platform.Platform) ComponentContainer(org.sonar.core.platform.ComponentContainer) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ComponentContainer (org.sonar.core.platform.ComponentContainer)2 Platform (org.sonar.server.platform.Platform)2