1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.http.server;
12
13 import static org.junit.Assert.assertFalse;
14 import static org.junit.Assert.assertTrue;
15
16 import org.junit.Test;
17
18 public class ServletUtilsTest {
19 @Test
20 public void testAcceptGzip() {
21 assertFalse(ServletUtils.acceptsGzipEncoding((String) null));
22 assertFalse(ServletUtils.acceptsGzipEncoding(""));
23
24 assertTrue(ServletUtils.acceptsGzipEncoding("gzip"));
25 assertTrue(ServletUtils.acceptsGzipEncoding("deflate,gzip"));
26 assertTrue(ServletUtils.acceptsGzipEncoding("gzip,deflate"));
27
28 assertFalse(ServletUtils.acceptsGzipEncoding("gzip(proxy)"));
29 assertFalse(ServletUtils.acceptsGzipEncoding("proxy-gzip"));
30 }
31 }