Commit Graph
35 Commits
Author SHA1 Message Date
thischwaandClaude Opus 5.5 c3a5c5f3e5 test: cover AI code review changes in CfClientTest (#2)
Build and Analyse / build-and-analyse (push) Successful in 30s
- live tests for API error details (status code, Cloudflare errors),
  404 on deleting an unknown record, unknown zones with and without
  emptyResultThrowsException, closing the client, multi-level
  subdomains and the zone apex, server- and client-side type filter,
  record attributes (priority, comment, SRV data) and Instant
  timestamps
- testPaging fetches all pages with a small page size, therefore
  CfDnsClient got a package-private constructor with a custom page size
- testDns checks that recordUpdate doesn't modify the given record
- SRV records: the priority is part of the data, fixed javadoc,
  README and changelog accordingly

refs #2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 18:02:16 +01:00
thischwaandClaude Opus 5.5 732f92ee78 AI code review: fix bugs, rename sld to subdomain, improve usability (#2)
- bug fixes: API errors are no longer wrapped into "Unexpected error!",
  zoneGet no longer crashes on unknown zones, getSubdomain handles apex
  and multi-level names, batch operations send the full record name,
  list methods fetch all pages, recordDelete handles empty results
- rename "sld" to "subdomain": getSubdomain(), recordCreateSubdomain(),
  old methods deprecated; "@" (CfDnsClient.APEX) addresses the apex
- one shared HTTP client with connection pooling, CfDnsClient
  implements AutoCloseable
- CloudflareApiException provides HTTP status code and Cloudflare
  errors, HTTP 404 throws CloudflareNotFoundException
- RecordEntity supports priority, data, comment and tags
- recordCreate/recordUpdate send only writable attributes and don't
  modify the given record
- breaking: recordList overloads replaced by recordListBySubdomain and
  recordListByType, timestamps are java.time.Instant
- single record type is filtered server-side (?type=)
- tests, README and changelog updated

refs #2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 15:44:25 +01:00
thischwaandClaude Opus 5.5 31229ff627 update README and fix "getRecord" wording in docs and messages
Build and Analyse / build-and-analyse (push) Successful in 24s
- README: fix fluent API examples (getRecord), complete recordCreate
  docs, document paging, groupRecordsByFqdn, recordDelete by id and
  multiple types in recordDeleteTypeIfExists, mention Java 17
- replace stray "getRecord" wording with "record" in javadoc, log and
  exception messages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 12:25:27 +01:00
thischwa 42e06245e1 fix #1 migrate codebase to Jackson 3.x 2026-08-05 17:42:04 +02:00
thischwa 8bbcebc53c Add GitHub Actions for Maven setup, JUnit reporting, and SonarCloud analysis. Update README with SonarCloud badges, embed assets, and document breaking changes. Refactor APIs with paging support, add model class tests, and improve error messages and code quality. Fix #13 and fix #15. 2026-03-11 11:08:04 +01:00
thischwa 607b634b35 issue #11 - Refactor CfDnsClient with a simplified CfDnsClientBuilder for authentication and configuration. Update tests and README for new builder. Added authtification with apiToken 2026-01-23 17:26:58 +01:00
thischwa b593ca7311 issue #11 -Implement authentication refactor: Add CfAuth interface, ApiTokenAuth and EmailKeyAuth implementations, and CfAuthBuilder for flexible authentication in CfDnsClient. Update tests and adjust related classes for compatibility. 2026-01-23 15:36:17 +01:00
thischwa b241d8cf09 issue #9 - Refactor CfClientTest, CfDnsClient, and CfBasicHttpClient: improve error handling, enable record filtering, refine empty result behavior, and update tests for clarity and robustness. 2026-01-11 18:28:22 +01:00
thischwa 9e8ee5bb4a Refactor tests: Replace assertTrue(size >= 1) with assertFalse(isEmpty) for clarity and correctness. 2026-01-09 15:25:33 +01:00
thischwa 34010a4e77 issue #9: Add groupRecordsByFqdn utility to CfDnsClient, set zoneId in DNS record methods, and enhance tests for record validation and grouping. 2026-01-07 17:52:48 +01:00
thischwa 0f1248d08b issue #9: Refactor recordGet to recordList for consistency across API methods, update related documentation, and revise impacted tests. 2026-01-06 20:35:50 +01:00
thischwa acf2a2fc3b issue #9: Add recordList method to CfDnsClient, update Zone-level fluent API, and implement tests for DNS record listing with optional type filters. 2026-01-06 20:14:05 +01:00
thischwa a221de4792 issue #9:
Change default behavior of `emptyResultThrowsException` to `false`, update `ResponseValidator` for improved handling of single and multiple results, and enhance test coverage and documentation.

Add Fluent API for DNS operations, update `README`, and refactor `CfDnsClient` for zone-level chaining.

Validate record type in `RecordEntity#build`, throw exception for invalid types, and add test coverage.

Refactor `RecordEntity#getSld` to handle `zoneName` cases, improve null safety, and enhance substring logic.

Refactor `RecordEntity` getter (`getName` → `getSld`) for clarity, improve string handling in batch processing, and enhance type safety in HTTP operations. Update tests and documentation accordingly.

Refactor `deleteRequest` and `patchRequest` to accept `responseType` parameter for improved flexibility. Extract methods for cleaning and processing batch DNS records.

Refactor API method names for consistency (`zoneListAll` → `zoneList`, `zoneInfo` → `zoneGet`, `sldListAll` → `recordList`, `sldInfo` → `recordGet`) and update related documentation and tests.
2026-01-06 13:19:19 +01:00
thischwa 12c75914b1 Add test for handling unknown SLDs with sldInfo method. 2025-12-31 16:30:49 +01:00
thischwa 77a584afb6 fix issue #8: Refactor sldInfo to support filtering by multiple record types. Adjust related methods, tests, and documentation accordingly. 2025-12-31 13:19:56 +01:00
thischwa c75f9d74ca fix #7: Refactor sldInfo to return a list of records, update related methods and tests accordingly. Improve logging and exception handling for batch DNS operations. 2025-12-30 15:34:55 +01:00
thischwa a965f21d6b Add batch DNS operations documentation and refine logging format in CfDnsClient. Extend tests for record creation and deletion. 2025-12-27 16:48:26 +01:00
thischwa e12eaff137 fixed test for put 2025-12-26 09:47:52 +01:00
thischwa 596006276e fixed test for put 2025-12-25 21:18:30 +01:00
thischwa 0eaca55e95 issue #5 - Update pom.xml version to 0.2.0-beta.1-SNAPSHOT, enhance logging, and refine DNS batch record processing method. 2025-12-25 20:43:31 +01:00
thischwa b4ce867efc issue #6 - ResponseResultInfo#Errors: wrong object structure
issue #5 - Add batch DNS record operations and refactor Cloudflare API client.
2025-12-25 14:27:18 +01:00
thischwa 8246007d92 Add CfClientPenTest for penetration testing and enhance CfClientTest with environment checks 2025-08-18 20:12:40 +02:00
thischwa 997d0df060 Refactor CfClientTest to improve test clarity, ensure cleanup, and enhance validation logic 2025-08-18 19:16:40 +02:00
thischwa a5f892b86a Refactor ResultInfo to use Java record
Replaced the ResultInfo class with a Java record for conciseness and immutability. Adjusted related validation logic and method calls to align with the new record structure. Minor updates to Javadoc documentation were also included.
2025-04-26 18:40:38 +02:00
thischwa 25855078f8 Add unit tests for ResponseValidator with Mockito integration
Introduced `ResponseValidatorTest` to comprehensively test the `ResponseValidator` class. Enhanced the project dependencies by updating JUnit to 5.12.2 and integrating Mockito with `mockito-junit-jupiter` 5.17.0 for mocking support. Clarified Javadoc for handling `RecordMultipleResponse` cases in `ResponseValidator`.
2025-04-26 11:38:05 +02:00
thischwa 697906a669 Refactor response handling with ResponseValidator class
Introduced a new ResponseValidator class to encapsulate response validation logic, improving code readability and maintainability. Updated CfDnsClient to delegate response validation to this new class. Adjusted tests to align with the refactor and ensure proper exception handling.
2025-04-25 18:56:35 +02:00
thischwa d9ec4f8c44 Regenerate Javadoc files for consistency
Refactor record creation method to improve clarity

Renamed `recordCreate` to `recordCreateSld` to better align with its function of creating records specifically for SLDs. Updated relevant tests, documentation, and method references to use the new naming for consistency and improved readability
2025-04-23 16:33:04 +02:00
thischwa aa1691c1e1 Refactor test formatting and add validation in CfClientTest
Adjusted inconsistent indentation and formatting in test cases for improved readability. Added additional test assertions for invalid input validation in the CfDnsClient constructor to enhance test coverage.
2025-04-21 14:27:45 +02:00
thischwa e0f9043389 Refactor constants and add private constructor in JsonConf.
Changed API_EMAIL and API_KEY to static final for proper constant usage. Added a private constructor in JsonConf to prevent instantiation, ensuring adherence to utility class design principles.
2025-04-21 14:16:24 +02:00
thischwa c1675d0fba Refactor response handling and centralize JSON configuration
Replaced direct fields in `AbstractResponse` with `ResponseResultInfo` for better encapsulation and consistency. Introduced `JsonConf` to provide a shared, reusable `ObjectMapper` configuration. Updated tests and logic to align with the refactored response structure, enhancing maintainability and readability.
2025-04-21 14:06:25 +02:00
thischwa 4902d0062a Improve logging and update dependencies
Enabled detailed logging for DNS record operations and adjusted log levels. Updated Maven dependencies, including httpclient5, logback, and added explicit SLF4J configurations. Minor changes to the logging configuration file and project structure for better test isolation.
2025-04-18 13:19:40 +02:00
thischwa 0e5b878e9f Refactor DNS record handling and add record creation method
Introduced `buildFqdn` utility to avoid redundancy in FQDN construction. Added `recordCreate` method for simpler record creation with specified parameters. Enhanced `recordDeleteTypeIfExists` to handle multiple record types and improved test cases for better clarity and consistency.
2025-04-18 11:49:24 +02:00
thischwa 97b7f8371a 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.
2025-04-13 19:57:15 +02:00
thischwa 34ea8e1b62 fixed issue #3 2025-04-13 17:33:50 +02:00
thischwa c39e022e41 Initial commit 2025-03-23 12:12:53 +01:00