Skip to content

Fix AAA initialization issue#2575

Merged
ihrasko merged 3 commits intoPANTHEONtech:mainfrom
Tobianas:aaa_fix
Mar 10, 2026
Merged

Fix AAA initialization issue#2575
ihrasko merged 3 commits intoPANTHEONtech:mainfrom
Tobianas:aaa_fix

Conversation

@Tobianas
Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @Tobianas, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on a significant upgrade of the testing infrastructure from JUnit 4 to JUnit 5 across multiple modules, ensuring modern testing practices and improved maintainability. Concurrently, it resolves a critical bug in the AAA module's database user initialization, enhancing system robustness. A minor but important enhancement was also made to the Jetty server to support session handling.

Highlights

  • JUnit 5 Migration: Migrated numerous test classes and methods across various modules from JUnit 4 to JUnit 5 (Jupiter), updating annotations, assertion imports, and method visibility to align with JUnit 5 best practices.
  • Dependency Updates: Updated pom.xml files in lighty-core/lighty-codecs-util, lighty-examples/lighty-community-aaa-restconf-app, lighty-modules/lighty-gnmi/lighty-gnmi-connector, and lighty-modules/lighty-gnmi/lighty-gnmi-device-simulator to replace JUnit 4 dependencies with JUnit Jupiter.
  • AAA Initialization Fix: Addressed an issue in the AAA module's initialization logic to correctly use getDbUsername() for database user configuration and gracefully handle scenarios where pre-seeded users already exist, preventing initialization failures.
  • Jetty Server Enhancement: Introduced a session handler to the AbstractLightyWebServer in the Jetty server module, enabling session management for web contexts.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • lighty-applications/lighty-app-modules-config/src/test/java/io/lighty/applications/util/ModulesConfigTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-applications/lighty-rcgnmi-app-aggregator/lighty-rcgnmi-app-module/src/test/java/io/lighty/applications/rcgnmi/module/RcGnmiAppModuleConfigUtilsTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-applications/lighty-rcgnmi-app-aggregator/lighty-rcgnmi-app-module/src/test/java/io/lighty/applications/rcgnmi/module/RcGnmiAppModuleTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-applications/lighty-rcgnmi-app-aggregator/lighty-rcgnmi-app/src/test/java/io/lighty/applications/rcgnmi/app/RCgNMIAppTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-app/src/test/java/io/lighty/applications/rnc/app/MainTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-module/src/test/java/io/lighty/applications/rnc/module/OpenApiTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-module/src/test/java/io/lighty/applications/rnc/module/RncLightyModuleSmokeTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-module/src/test/java/io/lighty/applications/rnc/module/config/RncLightyModuleConfigUtilsTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-codecs-util/pom.xml
    • Replaced JUnit 4 dependencies with JUnit Jupiter API and Engine dependencies.
  • lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/AbstractCodecTest.java
    • Updated JUnit assertion imports from org.junit.Assert to org.junit.jupiter.api.Assertions.
  • lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/ConverterUtilsTest.java
    • Updated JUnit imports, class, and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/JsonNodeConverterTest.java
    • Updated JUnit imports, class, and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/XmlNodeConverterTest.java
    • Updated JUnit imports, class, and method visibility to package-private for JUnit 5 compatibility.
    • Replaced @Ignore annotation with @Disabled for JUnit 5.
  • lighty-core/lighty-common/src/test/java/io/lighty/core/common/SocketAnalyzerTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-common/src/test/java/io/lighty/core/common/models/tests/YangModulesToolTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller-guice-di/src/test/java/io/lighty/core/controller/guice/tests/GuiceDITest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller-spring-di/src/test/java/io/lighty/core/controller/spring/LightyCoreSpringConfigurationTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/api/LightyModuleTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/api/SystemReadyMonitorTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/config/ConfigLoadingTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/datainit/DataInitTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerDataBrokerTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerMountPointTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerNotificationTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/services/LightyDiagStatusServiceImplTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/util/FileToDatastoreUtilsTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-examples/lighty-community-aaa-restconf-app/pom.xml
    • Replaced JUnit 4 dependency with JUnit Jupiter API and Engine dependencies.
  • lighty-examples/lighty-community-aaa-restconf-app/src/test/java/io/lighty/kit/examples/community/CommunityAAARestconfAppTest.java
    • Updated JUnit imports, class, and method visibility to package-private for JUnit 5 compatibility.
  • lighty-examples/lighty-community-netty-restconf-app/src/test/java/io/lighty/controllers/nettyrestconfapp/tests/RestconfAppTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-examples/lighty-community-restconf-actions-app/src/test/java/io/lighty/examples/controller/actions/RestconfActionsAppTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-examples/lighty-community-restconf-netconf-app/src/test/java/io/lighty/examples/controllers/restconfapp/tests/RestconfAppTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-examples/lighty-controller-springboot-netconf/src/test/java/io/lighty/core/controller/springboot/test/SpringBootAppTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-examples/lighty-guice-app/src/test/java/io/lighty/examples/controllers/guice/LightyGuiceAppTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/integration-tests/src/test/java/io/lighty/modules/southbound/netconf/tests/CallhomePluginTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/integration-tests/src/test/java/io/lighty/modules/southbound/netconf/tests/TopologyPluginsTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-aaa-aggregator/lighty-aaa/src/main/java/io/lighty/aaa/AAALightyShiroProvider.java
    • Corrected the database user property from getUsername() to getDbUsername().
    • Improved user creation logic to handle existing users gracefully during pre-seeding, logging debug messages instead of errors.
  • lighty-modules/lighty-aaa-aggregator/lighty-aaa/src/test/java/io/lighty/aaa/ShiroInitializationTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-aaa-aggregator/lighty-aaa/src/test/java/io/lighty/aaa/config/AAAConfigUtilsTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-aaa-aggregator/lighty-aaa/src/test/java/io/lighty/aaa/config/CertificateManagerConfigTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-aaa-aggregator/lighty-aaa/src/test/java/io/lighty/aaa/config/DatastoreConfigurationConfigTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-aaa-aggregator/lighty-aaa/src/test/java/io/lighty/aaa/config/ShiroConfigurationConfigTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-commons/src/test/java/io/lighty/modules/gnmi/commons/util/GnmiDataConverterTest.java
    • Updated test method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-connector/pom.xml
    • Removed JUnit 4 dependency and added JUnit Jupiter API and Engine dependencies.
  • lighty-modules/lighty-gnmi/lighty-gnmi-connector/src/test/java/io/lighty/modules/gnmi/connector/tests/gnmi/GnmiTest.java
    • Updated JUnit imports, class, and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-connector/src/test/java/io/lighty/modules/gnmi/connector/tests/gnoi/GnoiTest.java
    • Updated JUnit imports, class, and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-device-simulator/pom.xml
    • Replaced JUnit 4 dependency with JUnit Jupiter API and Engine dependencies.
  • lighty-modules/lighty-gnmi/lighty-gnmi-device-simulator/src/test/java/io/lighty/modules/gnmi/simulatordevice/gnmi/LoadAugmentationFromGnmiPath.java
    • Updated JUnit imports, class, and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-device-simulator/src/test/java/io/lighty/modules/gnmi/simulatordevice/test/DeviceCreationTest.java
    • Updated JUnit imports, class, and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/device/KeystoreGnmiSecurityTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/device/SessionInitializeTest.java
    • Updated test method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/lightymodule/GnmiConfigUtilsTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/lightymodule/GnmiSouthBoundModuleTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/codecs/GetResponseToNormalizedNodeCodecTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/codecs/YangInstanceIdentifierToGnmiPathCodecTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/codecs/YangInstanceNormToGnmiUpdateCodecTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/transactions/ReadWriteTxTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/transactions/WriteTransactionTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/schema/SchemaConstructTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-test/pom.xml
    • Removed JUnit 4 dependency.
  • lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/AuthenticationTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/GnmiWithoutRestconfTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/SimulatorCrudTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/rcgnmi/GnmiCertificatesTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/rcgnmi/GnmiConnectionITTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/rcgnmi/GnmiGetITTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/rcgnmi/GnmiSetITTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/rcgnmi/GnmiUploadModelsITTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnoi/FileServiceTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-jetty-server/src/main/java/io/lighty/server/AbstractLightyWebServer.java
    • Added a SessionHandler to the ServletContextHandler to enable session management.
  • lighty-modules/lighty-jetty-server/src/test/java/io/lighty/server/LightyJettyServerProviderTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/AAAEncryptionServiceTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfBaseServiceBaseTest.java
    • Updated test method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfBaseServiceTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfNmdaBaseServiceTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/SampleConfigTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-openapi/src/test/java/io/lighty/openapi/OpenApiLightyRFC8040Test.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-openapi/src/test/java/io/lighty/openapi/OpenApiLightyTest.java
    • Updated test method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-restconf-nb-community/src/test/java/io/lighty/modules/northbound/restconf/community/impl/tests/CommunityRestConfTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-restconf-nb-community/src/test/java/io/lighty/modules/northbound/restconf/community/impl/tests/RestConfConfigurationTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-restconf-nb-community/src/test/java/io/lighty/modules/northbound/restconf/community/impl/tests/YangPatchTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-restconf-netty-nb-community/src/test/java/io/lighty/modules/northbound/netty/restconf/community/impl/tests/NettyRestConfConfigurationTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-restconf-netty-nb-community/src/test/java/io/lighty/modules/northbound/netty/restconf/community/impl/tests/NettyRestConfTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
  • lighty-modules/lighty-restconf-netty-nb-community/src/test/java/io/lighty/modules/northbound/netty/restconf/community/impl/tests/YangPatchTest.java
    • Updated test class and method visibility to package-private for JUnit 5 compatibility.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request primarily focuses on updating test classes across various modules to use JUnit 5 annotations (@Test, @BeforeEach, @AfterEach, @BeforeAll, @AfterAll) and assertions (Assertions.assertEquals, Assertions.assertTrue, etc.) instead of JUnit 4 and TestNG. It also updates the pom.xml files to reflect the JUnit 5 dependencies. Additionally, there's a critical fix in AAALightyShiroProvider.java to correctly handle user creation in the AAA module, ensuring that pre-seeded users are created only if they don't already exist and logging appropriate messages. A minor change in AbstractLightyWebServer.java adds a session handler to the servlet context. Overall, the changes improve the testing framework and address a potential initialization issue in the AAA module.

Custom credentials from testConfig.json were ignored due to a database
initialization collision with OpenDaylight's BasicRealmAuthProvider.

JIRA: LIGHTY-426
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Add session handler to jetty server initialization to remove the exception
which was being thrown when using authentication:
java.lang.IllegalStateException: No SessionManager"

JIRA: LIGHTY-426
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
To create IdmLightConfig, just a regular username was being used
instead of the expected DbUsername from AAA configuration.

JIRA: LIGHTY-426
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
@ihrasko ihrasko merged commit 6da9a2b into PANTHEONtech:main Mar 10, 2026
6 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.

2 participants