Skip to content

Modified EscalationRepositoryTest class to include WorkflowUtil bean. #751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2025

Conversation

varunreddy-egov
Copy link
Collaborator

@varunreddy-egov varunreddy-egov commented May 26, 2025

Summary by CodeRabbit

  • Tests
    • Added a new mocked dependency to improve test setup in escalation repository tests.

Copy link

coderabbitai bot commented May 26, 2025

Walkthrough

A new mocked dependency, WorkflowUtil, has been added to the EscalationRepositoryTest class as a @MockBean. This change involves only the import and declaration of the mock, with no modifications to existing test methods or logic.

Changes

File(s) Change Summary
core-services/egov-workflow-v2/src/test/.../EscalationRepositoryTest.java Added @MockBean and import for WorkflowUtil dependency.

Poem

A mock hops in, so light and new,
To help our tests, as rabbits do.
No logic changed, just space prepared,
For future tests, the code is spared.
With gentle paws, we mock and wait—
For workflows tested, up-to-date!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e8d2bb and aaf08c2.

📒 Files selected for processing (1)
  • core-services/egov-workflow-v2/src/test/java/org/egov/wf/repository/EscalationRepositoryTest.java (2 hunks)
🔇 Additional comments (1)
core-services/egov-workflow-v2/src/test/java/org/egov/wf/repository/EscalationRepositoryTest.java (1)

14-14: Approve import addition

Importing WorkflowUtil aligns with the new mock bean declaration and satisfies the test context’s dependency requirements.

Comment on lines +37 to +38
@MockBean
private WorkflowUtil util;
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify necessity and naming of the new mock bean

You’ve added a @MockBean private WorkflowUtil util; to satisfy the repository’s dependency, but the field is currently unused in the test. Please:

  1. Confirm that EscalationRepository actually autowires and uses WorkflowUtil in the production code.
  2. Rename util to workflowUtil for clarity and consistency with the class name.
  3. Stub or verify interactions with this mock in existing or new test methods if needed.

🏁 Script executed:

#!/bin/bash
# Check if EscalationRepository uses WorkflowUtil
rg -n "WorkflowUtil" core-services/egov-workflow-v2/src/main/java/org/egov/wf/repository/EscalationRepository.java

Length of output: 308


Confirm and refine the WorkflowUtil mock in EscalationRepositoryTest

The EscalationRepository constructor does inject a WorkflowUtil instance (see lines 25 and 28 in EscalationRepository.java), so supplying a @MockBean is needed to load the Spring test context—but the mock is currently unused in your tests. Please:

• In
core-services/egov-workflow-v2/src/test/java/org/egov/wf/repository/EscalationRepositoryTest.java
– rename the field from util to workflowUtil (lines 37–38) for clarity.
• If any repository methods under test call into WorkflowUtil, stub or verify those interactions on workflowUtil.
• If none of the exercised code paths invoke WorkflowUtil, consider removing the unused mock altogether.

🤖 Prompt for AI Agents
In
core-services/egov-workflow-v2/src/test/java/org/egov/wf/repository/EscalationRepositoryTest.java
around lines 37 to 38, the mock bean for WorkflowUtil is currently unused and
named 'util', which reduces clarity. Rename the field to 'workflowUtil' for
consistency with the class name, and verify if the test methods invoke any
methods on this mock; if so, stub or verify those interactions. If the mock is
not used in any test, consider removing it to clean up the test class.

@talele08 talele08 merged commit 4582a98 into master May 26, 2025
3 checks passed
talele08 added a commit that referenced this pull request May 29, 2025
* Added keycloak build config (#714)

* adding githubactions workflow file (#715)

* updating workflows action flow to pick from master and create images from all the branches (#718)

* adding githubactions workflow file

* Update build.yaml

* Adding drop downs while triggering githubactions (#727)

* Create sandbox.yml (#730)

* Create sandbox.yml

* Update sandbox.yml

* Update sandbox.yml (#732)

* Update build.yaml (#734)

* Add business-services folder and new service to workflow inputs (#735)

* Add business-services folder and new service to workflow inputs

* Add business-services folder and new service to workflow inputs

* Add business-services folder and new service to workflow inputs

* Add business-services folder and new service to workflow inputs

* Update build.yaml with correct service names

---------

Co-authored-by: nikhilmulinti <127198713+nikhilmulinti@users.noreply.github.com>

* Update sandbox.yml (#738)

* added open telemetry (#748)

* Updated idgen service

* Updated mdms-v2 service

* Updated workflow service

* Updated egov-localization service

* updated egov-location service

* Updated tenant-management service

* WIP: changes to Dockerfile and workflow

* Update build dockerfile

* Updated audit service

* Updated boundary service

* Updated access control

* Updated enc service

* Updated file store

* Updated egov-indexer

* updated mdms v1 service

* Updated egov notification mail service

* Updated notification sms

* Updated egov-otp

* updated egov persister

* Updated pg service

* Updated egov url shortening

* Updated egov-user-event

* Updated gateway service

* Updated service request

* Updated Dockerfile

* Update Dockerfile-java 8

* Update Dockerfile- reverting back

* Modified gateway POM according to new tracer.

* Added opentelemetry tracing & @CustomSafeHtml in tracer.

* Update Dockerfile

* updated idgen

* Updated localization

* Updated mdms v2

* Updated workflow v2

* Updated location

* Updated audit service

* Updated boundary service

* Updated access control

* Updated enc service

* Updated filestore

* updated indexer

* Added logic to replace {schema} placeholder in EscalationRepository class.

* Updated mdms service

* Updated notification mail

* updated notification sms

* Updated egov-otp

* Updated persister

* Updated pg service

* Updated url shortening

* Updated user event

* Updated gateway

* Updated service request

* Update enc-client from 2.9.0-SNAPSHOT to 2.9.1 pom.xml

---------

Co-authored-by: Varun Reddy <155146627+varunreddy-egov@users.noreply.github.com>
Co-authored-by: nikhilmulinti <127198713+nikhilmulinti@users.noreply.github.com>
Co-authored-by: varunreddy-egov <varun.kumar@egovernments.org>

* Modified EscalationRepositoryTest class to include WorkflowUtil bean. (#751)

* Updated Changelog in New open telemetry (#752)

* Updated idgen service

* Updated mdms-v2 service

* Updated workflow service

* Updated egov-localization service

* updated egov-location service

* Updated tenant-management service

* WIP: changes to Dockerfile and workflow

* Update build dockerfile

* Updated audit service

* Updated boundary service

* Updated access control

* Updated enc service

* Updated file store

* Updated egov-indexer

* updated mdms v1 service

* Updated egov notification mail service

* Updated notification sms

* Updated egov-otp

* updated egov persister

* Updated pg service

* Updated egov url shortening

* Updated egov-user-event

* Updated gateway service

* Updated service request

* Updated Dockerfile

* Update Dockerfile-java 8

* Update Dockerfile- reverting back

* Modified gateway POM according to new tracer.

* Added opentelemetry tracing & @CustomSafeHtml in tracer.

* Update Dockerfile

* updated idgen

* Updated localization

* Updated mdms v2

* Updated workflow v2

* Updated location

* Updated audit service

* Updated boundary service

* Updated access control

* Updated enc service

* Updated filestore

* updated indexer

* Added logic to replace {schema} placeholder in EscalationRepository class.

* Updated mdms service

* Updated notification mail

* updated notification sms

* Updated egov-otp

* Updated persister

* Updated pg service

* Updated url shortening

* Updated user event

* Updated gateway

* Updated service request

* updated idgen

* Updated mdms v2

* updated location

* Updated audit service

* Updated access control

* Updated enc service

* updated filestore

* Updated indexer

* Updated mdms service

* Updated notification mail

* Updated notification sms

* updated egov otp

* Updated persister

* Updated pg service

* Updated url shortening

* updated user event

* Updated gateway

* Update service request

---------

Co-authored-by: Varun Reddy <155146627+varunreddy-egov@users.noreply.github.com>
Co-authored-by: nikhilmulinti <127198713+nikhilmulinti@users.noreply.github.com>
Co-authored-by: varunreddy-egov <varun.kumar@egovernments.org>

---------

Co-authored-by: Varun Reddy <155146627+varunreddy-egov@users.noreply.github.com>
Co-authored-by: nikhilmulinti <127198713+nikhilmulinti@users.noreply.github.com>
Co-authored-by: DIGIT-support <digit-success@equidhi.org>
Co-authored-by: talele08 <talele08@users.noreply.github.com>
Co-authored-by: shilpa-egov <shilpa.m@egovernments.org>
Co-authored-by: varunreddy-egov <varun.kumar@egovernments.org>
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