use of org.glassfish.grizzly.http.HttpHeader in project Payara by payara.
the class HSTSFilterTest method headerTestAllTrue.
@Test
public void headerTestAllTrue() throws IOException {
Ssl mockedSsl = Mockito.mock(Ssl.class);
Mockito.when(mockedSsl.getHstsEnabled()).thenReturn("true");
Mockito.when(mockedSsl.getHstsPreload()).thenReturn("true");
Mockito.when(mockedSsl.getHstsSubdomains()).thenReturn("true");
HttpHeader header = processFilter(mockedSsl);
Assert.assertEquals(EXPECTED_ALL, header.getHeader(HSTS_HEADER));
}
use of org.glassfish.grizzly.http.HttpHeader in project Payara by payara.
the class HSTSFilterTest method headerTestJustMax.
@Test
public void headerTestJustMax() throws IOException {
Ssl mockedSsl = Mockito.mock(Ssl.class);
Mockito.when(mockedSsl.getHstsEnabled()).thenReturn("true");
Mockito.when(mockedSsl.getHstsPreload()).thenReturn("false");
Mockito.when(mockedSsl.getHstsSubdomains()).thenReturn("false");
HttpHeader header = processFilter(mockedSsl);
Assert.assertEquals(EXPECTED_MAX, header.getHeader(HSTS_HEADER));
}
Aggregations