Skip to content

add unit tests#27

Open
devops-thiago wants to merge 1 commit intomasterfrom
add_unit_tests
Open

add unit tests#27
devops-thiago wants to merge 1 commit intomasterfrom
add_unit_tests

Conversation

@devops-thiago
Copy link
Owner

No description provided.

@devops-thiago devops-thiago requested review from Copilot and removed request for Copilot September 1, 2025 20:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive unit tests to the mongocom library, replacing the outdated JUnit 4 configuration with modern JUnit 5 and Mockito for better testing capabilities.

  • Adds comprehensive unit test coverage for core library components
  • Migrates from JUnit 4 to JUnit 5 with Mockito integration
  • Fixes documentation formatting issues in JavaDoc comments

Reviewed Changes

Copilot reviewed 20 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Multiple test files New unit tests covering utilities, types, management classes, exceptions, and annotations
pom.xml Updated to JUnit 5 and added Mockito dependencies with Surefire plugin configuration
Type classes Fixed HTML encoding in JavaDoc author tags
CollectionManager.java Minor code improvements and documentation fixes
MongoQuery.java Return defensive copies and improved documentation
CollectionManagerFactory.java Enhanced exception handling for illegal arguments

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 118 to 140

public Document getQuery() {
return query;
return query != null ? new Document(query) : null;
}

public Document getConstraints() {
return constraints;
return constraints != null ? new Document(constraints) : null;
}

public Document getOrderBy() {
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

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

[nitpick] The defensive copying approach is inconsistent with the original implementation and may break existing code that expects direct references. Consider documenting this breaking change or providing configuration options to maintain backward compatibility.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Sep 1, 2025

Codecov Report

❌ Patch coverage is 91.77215% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.46%. Comparing base (26d868b) to head (7570a48).

Files with missing lines Patch % Lines
...volivre/mongocom/management/CollectionManager.java 91.50% 7 Missing and 2 partials ⚠️
.../mongocom/management/CollectionManagerFactory.java 93.61% 0 Missing and 3 partials ⚠️
...m/arquivolivre/mongocom/management/MongoQuery.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master      #27       +/-   ##
=============================================
+ Coverage      0.00%   90.46%   +90.46%     
- Complexity        0      182      +182     
=============================================
  Files            10       10               
  Lines           537      556       +19     
  Branches         97      100        +3     
=============================================
+ Hits              0      503      +503     
+ Misses          537       38      -499     
- Partials          0       15       +15     
Flag Coverage Δ
unittests 90.46% <91.77%> (+90.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@devops-thiago devops-thiago force-pushed the add_unit_tests branch 5 times, most recently from 57bff32 to 021c1bd Compare September 2, 2025 21:05
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 2, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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