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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user