Refactor code style and add tests for exception handling

Adjusted code style to align with consistent brace formatting and removed the null/blank check for `baseUrl` in the constructor. Added unit tests to verify exception handling in `CfDnsClient` for null arguments.
This commit is contained in:
2025-04-13 19:57:15 +02:00
parent f0bc7b5446
commit 97b7f8371a
2 changed files with 63 additions and 29 deletions
@@ -89,4 +89,10 @@ public class CfClientTest {
client.recordDeleteTypeIfExists(z, sldStr, RecordType.A);
assertThrows(CloudflareNotFoundException.class, () -> client.sldInfo(z, sldStr, RecordType.A));
}
@Test
void testException() {
assertThrows(IllegalArgumentException.class, () -> new CfDnsClient(null, "key"));
assertThrows(IllegalArgumentException.class, () -> new CfDnsClient("email", null));
}
}