Skip to content

Fixed test framework - #82

Closed
anuragSharma1112 wants to merge 7 commits into
developfrom
testFix
Closed

Fixed test framework#82
anuragSharma1112 wants to merge 7 commits into
developfrom
testFix

Conversation

@anuragSharma1112

@anuragSharma1112 anuragSharma1112 commented Nov 13, 2025

Copy link
Copy Markdown
Collaborator

Description

Fix all the 26 Test cases, remove Test Container and use SQLite instead.

Fixes # (issue)
Test cases along with the new yml that will fix DEV profile (local running) issue as well.
For:
#77 #75

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit Tests
  • Integration Tests
  • Manual Testing (please describe)

Checklist:

  • I have created ADR (Architecture Decision Record) for this change, in case of architecture or tech stack changes.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes in other branches have been merged
  • I have updated the relevant application properties files (if needed)
  • I have updated any necessary database migrations (if needed)

Screenshots (for UX changes):

NA

Additional Notes:

NA

@anuragSharma1112

Copy link
Copy Markdown
Collaborator Author

Hi @axymthr plz review the changes for test framework, as lot of things we have to mocked so i created a saperate local yml for local setup and application.yml is as it is, also we disable/remove postgress test container and flyway as well.

@axymthr

axymthr commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

Hi @anuragSharma1112 why does this PR contain non-test framework related changes? Please raise a separate PR for functional changes.


@Service
@Profile({"dev", "test"})
@Profile({"dev", "local"})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need a 'local' profile?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hi @axymthr
We are implementing a 'local' profile to enforce a clean separation between our development and production environments. The main application.yml file will remain our single source of truth for production configuration, ensuring stability and security for our live system. The local profile allows us to override this configuration specifically for testing purposes—using an in-memory SQLite database instead of PostgreSQL, mocking external services like Azure OAuth with hardcoded values, and disabling non-essential components like database migrations. This approach eliminates dependencies on external systems during testing, speeds up development cycles by making tests faster and more reliable, and completely prevents any risk of production configuration being compromised during development activities.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That wasn't part of the scope for this ticket, please remove all "local" profile changes from this PR.
The standard "local" profile supported by Spring Boot is "dev". We need an application-dev.yml. The prod profile is already is application-prod.yml.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Revert this change, it doesn't run during tests. We need an app runner to maintain compatibility with Postgresql.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Revert this.


@SpringBootTest(classes = {WiremockMailServiceImpl.class, TestRestTemplateConfig.class})
@ActiveProfiles("local")
@TestPropertySource(properties = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Move these to application-test.yml or another test specific config file

@SpringBootTest
@ActiveProfiles("test")
@Import(TestcontainersConfiguration.class)
@ActiveProfiles("local")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this test running in a local profile? The default profile would be "test" which should be sufficient

docker:
compose:
lifecycle-management: start_only
profiles:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove from this PR, it is the wrong way to do it anyway.

Comment thread web-backend/src/main/resources/application-local.yml

@Service
@Profile({"dev", "test"})
@Profile({"dev", "local"})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That wasn't part of the scope for this ticket, please remove all "local" profile changes from this PR.
The standard "local" profile supported by Spring Boot is "dev". We need an application-dev.yml. The prod profile is already is application-prod.yml.

@axymthr
axymthr deleted the testFix branch November 29, 2025 10:38
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