Skip to content

Commit 4bd580e

Browse files
committed
Add test for NullPointerException when setting null statusText
1 parent e71b1d7 commit 4bd580e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/test/java/org/juv25d/http/HttpResponseTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.juv25d.http;
22

33
import org.junit.jupiter.api.Test;
4-
54
import static org.junit.jupiter.api.Assertions.*;
65

76
public class HttpResponseTest {
@@ -32,6 +31,12 @@ void shouldSetAndReturnStatusText() {
3231
assertEquals("Not found", response.statusText());
3332
}
3433

34+
@Test
35+
void shouldThrowExceptionWhenStatusTextIsNull() {
36+
HttpResponse response = new HttpResponse();
37+
assertThrows(NullPointerException.class, () -> response.setStatusText(null));
38+
}
39+
3540
@Test
3641
void shouldHaveEmptyHeaderByDefault() {
3742
HttpResponse response = new HttpResponse();

0 commit comments

Comments
 (0)