Polish contribution

Closes gh-11809
This commit is contained in:
Stephane Nicoll
2018-01-27 05:33:49 +01:00
parent a0fb138771
commit 6569ed8739

View File

@@ -38,6 +38,7 @@ import static org.assertj.core.api.Assertions.entry;
* Tests for {@link EndpointServlet}.
*
* @author Phillip Webb
* @author Stephane Nicoll
*/
public class EndpointServletTests {
@@ -71,6 +72,20 @@ public class EndpointServletTests {
assertThat(endpointServlet.getServlet()).isEqualTo(servlet);
}
@Test
public void withInitParameterNullName() {
EndpointServlet endpointServlet = new EndpointServlet(TestServlet.class);
this.thrown.expect(IllegalArgumentException.class);
endpointServlet.withInitParameters(Collections.singletonMap(null, "value"));
}
@Test
public void withInitParameterEmptyName() {
EndpointServlet endpointServlet = new EndpointServlet(TestServlet.class);
this.thrown.expect(IllegalArgumentException.class);
endpointServlet.withInitParameters(Collections.singletonMap(" ", "value"));
}
@Test
public void withInitParameterShouldReturnNewInstance() {
EndpointServlet endpointServlet = new EndpointServlet(TestServlet.class);