i spent the last year just spinning

This commit is contained in:
Relism
2026-04-17 18:56:06 +02:00
parent 9efbe38c0c
commit e161497f2c
77 changed files with 2545 additions and 877 deletions
@@ -21,7 +21,11 @@ class ContentTypeTest {
void getBytes_instancesAreNotNull() {
for (ContentType ct : ContentType.values()) {
assertNotNull(ct.getBytes());
assertTrue(ct.getBytes().length > 0);
if (ct == ContentType.NONE) {
assertEquals(0, ct.getBytes().length);
} else {
assertTrue(ct.getBytes().length > 0);
}
}
}
}
@@ -31,4 +31,13 @@ class HttpStatusTest {
assertArrayEquals("301 Moved Permanently".getBytes(StandardCharsets.UTF_8), HttpStatus.bytesForCode(301));
assertArrayEquals("400 Bad Request".getBytes(StandardCharsets.UTF_8), HttpStatus.bytesForCode(400));
}
@Test
void reasonForCode_validAndUnknownCodes() {
assertEquals("OK", HttpStatus.reasonForCode(200));
assertEquals("Not Found", HttpStatus.reasonForCode(404));
assertEquals("Internal Server Error", HttpStatus.reasonForCode(500));
assertNull(HttpStatus.reasonForCode(999));
assertNull(HttpStatus.reasonForCode(0));
}
}