@Test public void getAllowHeaderWithSupportedMethodsConstructor() throws Exception { WebContentGenerator generator = new TestWebContentGenerator("POST"); assertEquals("POST,OPTIONS", generator.getAllowHeader()); }
@Test public void getAllowHeaderWithConstructorTrue() throws Exception { WebContentGenerator generator = new TestWebContentGenerator(true); assertEquals("GET,HEAD,POST,OPTIONS", generator.getAllowHeader()); }
@Test public void getAllowHeaderWithConstructorFalse() throws Exception { WebContentGenerator generator = new TestWebContentGenerator(false); assertEquals("GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS", generator.getAllowHeader()); }
@Test public void getAllowHeaderWithSupportedMethodsSetterEmpty() throws Exception { WebContentGenerator generator = new TestWebContentGenerator(); generator.setSupportedMethods(); assertEquals("Effectively \"no restriction\" on supported methods", "GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS", generator.getAllowHeader()); }
@Test public void getAllowHeaderWithSupportedMethodsSetter() throws Exception { WebContentGenerator generator = new TestWebContentGenerator(); generator.setSupportedMethods("POST"); assertEquals("POST,OPTIONS", generator.getAllowHeader()); }