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

Add unit tests for optimize extension #105

Open
wants to merge 2 commits into
base: dev-v3.2.0
Choose a base branch
from

Conversation

ishita-gambhir-adobe
Copy link
Contributor

@ishita-gambhir-adobe ishita-gambhir-adobe commented Oct 15, 2024

Description

Adding unit tests for optimize extension

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.03%. Comparing base (e14d4ff) to head (8ae0fc3).
Report is 23 commits behind head on dev-v3.2.0.

Additional details and impacted files
@@               Coverage Diff                @@
##             dev-v3.2.0     #105      +/-   ##
================================================
+ Coverage         82.58%   83.03%   +0.45%     
- Complexity          206      209       +3     
================================================
  Files                 9        9              
  Lines               999     1002       +3     
  Branches            159      159              
================================================
+ Hits                825      832       +7     
+ Misses               95       92       -3     
+ Partials             79       78       -1     
Flag Coverage Δ
functional-tests 54.79% <0.00%> (-0.16%) ⬇️
unit-tests 79.14% <100.00%> (+0.46%) ⬆️

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

Files with missing lines Coverage Δ
...e/marketing/mobile/optimize/OptimizeExtension.java 82.07% <100.00%> (+1.28%) ⬆️

@ishita-gambhir-adobe ishita-gambhir-adobe changed the title Add unit and functional tests for optimize extension Add unit tests for optimize extension Oct 15, 2024
+ " xcore:offer-activity:1111111111111111/xcore:offer-placement:1111111111111111",
aepOptimizeError.getDetail());
Assert.assertEquals("Not Found", aepOptimizeError.getTitle());
extension.clearUpdateRequestEventIdsErrors();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can we move extension.clearUpdateRequestEventIdsErrors(); to the @After block so it is not repeated in every single test?

Copy link
Contributor

@spoorthipujariadobe spoorthipujariadobe left a comment

Choose a reason for hiding this comment

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

Could you please also add tests for

  1. testHandleEdgeErrorResponse_nullRequestEventId
  2. testHandleEdgeErrorResponse_emptyRequestEventId
  3. testHandleEdgeErrorResponse_requestEventIdNotBeingTracked

Additionally do you think it makes sense to move the check OptimizeUtils.isNullOrEmpty(event.getEventData()) before we get the requestEventId from the event data. as the first statement in the try block in handleEdgeErrorResponse ?

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