]> WPIA git - gigi.git/blob - tests/club/wpia/gigi/TestSecurityHeaders.java
fix: ResultSet.getDate is often wrong as it fetches day-precision times
[gigi.git] / tests / club / wpia / gigi / TestSecurityHeaders.java
1 package club.wpia.gigi;
2
3 import static org.junit.Assert.*;
4
5 import java.io.IOException;
6 import java.net.HttpURLConnection;
7
8 import org.junit.Test;
9
10 import club.wpia.gigi.testUtils.ManagedTest;
11
12 public class TestSecurityHeaders extends ManagedTest {
13
14     @Test
15     public void testSTS() throws IOException {
16         HttpURLConnection uc = get(null, "/");
17         assertNotNull(uc.getHeaderField("Strict-Transport-Security"));
18     }
19
20     public void testCSP() throws IOException {
21         HttpURLConnection uc = get(null, "/");
22         assertNotNull(uc.getHeaderField("Content-Security-Policy"));
23     }
24
25     public void testAllowOrigin() throws IOException {
26         HttpURLConnection uc = get(null, "/");
27         assertNotNull(uc.getHeaderField("Access-Control-Allow-Origin"));
28
29     }
30 }