Skip to content

Conversation

@peterjhill
Copy link
Contributor

  • Removed all Lombok annotations and replaced with explicit builders, constructors, and accessors
  • Added null-safety using Objects.requireNonNull across builder and constructor inputs
  • Fixed SpotBugs warnings (EI_EXPOSE_REP, UPM, DLS) with defensive copies and suppression annotations
  • Improved XML parsing robustness and logging for better debuggability
  • Removed unused or redundant private methods and variables
  • Prepped codebase for modern Java versions (Java 17+ compatibility)

This refactor preserves public APIs but improves maintainability, static analysis, and future extensibility.

@peterjhill
Copy link
Contributor Author

ah, check this out:
Command: mvn test -Dtest=NetconfIntegrationTest -Dnetconf.integration.enabled=true -Dnetconf.host=localhost -Dnetconf.username=test -Dnetconf.password= -Dnetconf.port=1830 -Dnetconf.timeout=30000

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< net.juniper.netconf:netconf-java >------------------
[INFO] Building net.juniper.netconf:netconf-java 2.2.0.0
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ netconf-java ---
[INFO] skip non existing resourceDirectory /Users/pjhill/Source/netconf-java/src/main/resources
[INFO]
[INFO] --- compiler:3.8.0:compile (default-compile) @ netconf-java ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- resources:3.3.1:testResources (default-testResources) @ netconf-java ---
[INFO] Copying 6 resources from src/test/resources to target/test-classes
[INFO]
[INFO] --- compiler:3.8.0:testCompile (default-testCompile) @ netconf-java ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- surefire:3.0.0-M3:test (default-test) @ netconf-java ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running net.juniper.netconf.integration.NetconfIntegrationTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.853 s - in net.juniper.netconf.integration.NetconfIntegrationTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.986 s
[INFO] Finished at: 2025-06-18T15:12:16-07:00
[INFO] ------------------------------------------------------------------------

=== Integration Tests Complete ===

- Removed all Lombok annotations and replaced with explicit builders, constructors, and accessors
- Fixed SpotBugs warnings (EI_EXPOSE_REP, UPM, DLS) with defensive copies and suppression annotations
- Improved XML parsing robustness and logging for better debuggability
- Removed unused or redundant private methods and variables
- Prepped codebase for modern Java versions (Java 17+ compatibility)

This refactor preserves public APIs but improves maintainability, static analysis, and future extensibility.

Highlights
	•	Gradle 8 / Java 17 compatibility
	•	Added Gradle wrapper & build instructions, updated .gitignore (build/)
	•	Upgraded SpotBugs to 6.x; replaced deprecated string→enum coercion
	•	Adopted Gradle Testing Suites DSL (useJUnitJupiter('5.11.1')) and removed manual JUnit deps
	•	Eliminated all empty <p> tags, malformed HTML, missing @param/@return, and default-ctor warnings
	•	Added @SuppressWarnings("unchecked") where parent class returns raw types
	•	Deprecated API cleanup
	•	Replaced MockitoAnnotations.initMocks with openMocks + AutoCloseable teardown
	•	README refresh

These changes remove all Javadoc/SpotBugs/Gradle deprecation warnings and prepare the project for Gradle 9 + Java 17 while keeping Maven support intact.
* Merged :confirmed-commit:1.1, cancel-commit & kill-session bullet-points
  into the existing **v2.2.0** changelog
* Updated headline, feature list, build instructions (Gradle wrapper note),
  and Maven/Gradle code snippet (try-with-resources)

Added Integration tests. You can use juniper crpd eval and run with docker/colima. Once you set up a basic config to enable ssh and netconf, you can run the integration tests

Added tests to validate RFC 6242 MUSTs
@ydnath ydnath merged commit 8271420 into Juniper:master Jun 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants