]> WPIA git - gigi.git/blob - tests/org/cacert/gigi/TestSecurityHeaders.java
Merge "Suggestions to enhance the SQL call pattern."
[gigi.git] / tests / org / cacert / gigi / TestSecurityHeaders.java
1 package org.cacert.gigi;
2
3 import static org.junit.Assert.*;
4
5 import java.io.IOException;
6 import java.net.HttpURLConnection;
7
8 import org.cacert.gigi.testUtils.ManagedTest;
9 import org.junit.Test;
10
11 public class TestSecurityHeaders extends ManagedTest {
12
13     @Test
14     public void testSTS() throws IOException {
15         HttpURLConnection uc = get(null, "/");
16         assertNotNull(uc.getHeaderField("Strict-Transport-Security"));
17     }
18
19     public void testCSP() throws IOException {
20         HttpURLConnection uc = get(null, "/");
21         assertNotNull(uc.getHeaderField("Content-Security-Policy"));
22     }
23
24     public void testAllowOrigin() throws IOException {
25         HttpURLConnection uc = get(null, "/");
26         assertNotNull(uc.getHeaderField("Access-Control-Allow-Origin"));
27
28     }
29 }