Skip to content

refactor: replaced @Autowired annotations with constructor injections - #4425

Open
honeyverma1 wants to merge 9 commits into
eclipse-sw360:mainfrom
honeyverma1:constructor_injection
Open

refactor: replaced @Autowired annotations with constructor injections #4425
honeyverma1 wants to merge 9 commits into
eclipse-sw360:mainfrom
honeyverma1:constructor_injection

Conversation

@honeyverma1

Copy link
Copy Markdown

Summary

  • Remove redundant @Autowired annotations from classes with a single constructor.
  • Implemented Constructor Injections in classes where no Constructor was present.
  • Preserve the existing dependency injection behavior.
  • No functional changes intended.

Verification

  • Started the resource server successfully after the changes.
  • Verified that protected endpoints require authentication as expected.

@honeyverma1
honeyverma1 marked this pull request as draft August 1, 2026 06:31
@honeyverma1
honeyverma1 marked this pull request as ready for review August 1, 2026 13:38
@honeyverma1 honeyverma1 changed the title Removed @Autowired annotations and implemented Constructor Injections instead refactor: replaced @Autowired annotations with constructor injections Aug 1, 2026
GMishx
GMishx previously approved these changes Aug 3, 2026

@GMishx GMishx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@GMishx

GMishx commented Aug 3, 2026

Copy link
Copy Markdown
Member

@honeyverma1 , please follow the conventional commit messages. Your CI is failing.

@honeyverma1

Copy link
Copy Markdown
Author

@honeyverma1 , please follow the conventional commit messages. Your CI is failing.

noted sir. should I try to change the commit messages ??

@honeyverma1

Copy link
Copy Markdown
Author

regarding, Error: 🚫 According to the conventional-commits specification, some of the commit messages are not valid.
sir I can try to change the commit messages according to the conventions

dependabot Bot and others added 5 commits August 3, 2026 19:59
Bumps [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) from 4.36.2 to 4.37.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@8aad20d...e4fba86)

---
updated-dependencies:
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.37.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…ed Contructor injections.

Signed-off-by: honeyverma1 <honeyverma8240@gmail.com>
@honeyverma1

honeyverma1 commented Aug 3, 2026

Copy link
Copy Markdown
Author

@GMishx sir I have changed the commit messages and ensured every message follows the convention (in my best understanding), moreover I have force-pushed the changed commits. please can you verify again

@honeyverma1
honeyverma1 requested a review from GMishx August 3, 2026 14:56
@honeyverma1
honeyverma1 marked this pull request as draft August 3, 2026 20:46
@honeyverma1
honeyverma1 marked this pull request as ready for review August 4, 2026 04:00
@honeyverma1

honeyverma1 commented Aug 4, 2026

Copy link
Copy Markdown
Author

@GMishx sir I found that the tests were failing because I removed @Autowired from a method of class Sw360AuthorizationServerConfiguration. The function that was autowired is never called and neither is a constructor, hence I figured that the method needs to be annotated for it to configure the Authentication Manager. Please review

@honeyverma1

Copy link
Copy Markdown
Author

Moreover @GMishx sir, I am facing some abnormalities in configuring the couchdb-tests.properties in datahandler package.

The issue I noticed was that the couchdb-test.properties from the build-configuration test JAR was never getting unpacked into libraries/datahandler/target/test-classes. Moreover I re-installed maven multiple times still had to manually copy it into the expected location.

can you please give me an insight on this as well ??

@honeyverma1

Copy link
Copy Markdown
Author

hello @GMishx , i believe all the test have passed and the PR is ready to be merged. please verify

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