Skip to content
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

Implemented test case for JwtMiddleware #4418 #4411

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nikzayn
Copy link

@nikzayn nikzayn commented Jan 25, 2024

Proposed changes

  • Expected to add the test cases for JWT Middleware

Types of changes

  • Added the test cases for JWT Middleware

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)

Dependency

Special notes for your reviewer:

  • Retest the changes

@Saranya-jena
Copy link
Contributor

@nikzayn Can you please attach screenshots for the executed testcases and coverage?

@SarthakJain26
Copy link
Contributor

@nikzayn please address the comments, so that we can merge this PR

@nikzayn
Copy link
Author

nikzayn commented Mar 7, 2024

@nikzayn Can you please attach screenshots for the executed testcases and coverage?

Sorry, for the delay. I was actually out of town. I came back yesterday. I will update you on the following soon..!

@nikzayn
Copy link
Author

nikzayn commented Mar 7, 2024

@nikzayn please address the comments, so that we can merge this PR

I will update for sure..!!

@nikzayn
Copy link
Author

nikzayn commented Mar 8, 2024

Here are the screenshots of test execution and coverage output.

Screenshot 2024-03-08 at 1 11 49 PM

Screenshot 2024-03-08 at 1 27 35 PM

Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>
Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>
type MockApplicationService struct{}

// AddMember implements services.ApplicationService.
func (m *MockApplicationService) AddMember(projectID string, member *entities.Member) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

@nikzayn you can remove all these generated functions that are unimplemented.

})

// Subtest for Missing Authorization Header
t.Run("Missing Authorization Header", func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I see there's 30% code coverage with this TC, please check if you can add more TCs for more code coverage

@@ -0,0 +1,142 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

@nikzayn you can remove both the coverage files, you don't need to commit those generated files.

@Saranya-jena
Copy link
Contributor

@nikzayn are you still working on this PR?

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.

None yet

3 participants