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

CIF-1300 - Implement mock GraphQL HTTP endpoint for the components library pages #224

Merged
merged 20 commits into from
May 7, 2020

Conversation

cjelger
Copy link
Contributor

@cjelger cjelger commented Mar 13, 2020

Description

In order to have a self-contained content package for the components library pages, we develop a mock GraphQL HTTP endpoint that would contain sample JSON responses for all the CIF components of the library pages.

This PR contains an AEM Servlet that implements that GraphQL server. It uses the graphql-java to implement a real GraphQL server using the Magento 2.3.4 GraphQL schema. The JSON responses are mocked, and should be refined/adapted when we will start developing the library pages.

How Has This Been Tested?

The Servlet has been tested with all the server-side CIF Components that will be potentially used in the library pages. Each test uses the corresponding Sling Model and data retriever, so we exactly test all the GraphQL queries issued by the components.

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:

  • 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 and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

@cjelger cjelger requested review from mhaack, dplaton and LSantha March 16, 2020 09:20
@codecov
Copy link

codecov bot commented Mar 17, 2020

Codecov Report

Merging #224 into master will increase coverage by 0.67%.
The diff coverage is 90.69%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #224      +/-   ##
============================================
+ Coverage     62.32%   63.00%   +0.67%     
- Complexity      728      758      +30     
============================================
  Files           171      172       +1     
  Lines          5240     5368     +128     
  Branches        820      838      +18     
============================================
+ Hits           3266     3382     +116     
- Misses         1862     1869       +7     
- Partials        112      117       +5     
Flag Coverage Δ Complexity Δ
#jest 40.21% <ø> (ø) 0.00 <ø> (ø)
#karma 94.88% <ø> (ø) 0.00 <ø> (ø)
#unittests 85.16% <90.69%> (+0.34%) 758.00 <30.00> (+30.00)
Impacted Files Coverage Δ Complexity Δ
...models/v1/relatedproducts/RelatedProductsImpl.java 86.66% <0.00%> (-2.23%) 15.00 <0.00> (ø)
...ommerce/core/examples/servlets/GraphqlServlet.java 91.40% <91.40%> (ø) 30.00 <30.00> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 118d4b0...844b0ec. Read the comment docs.

@cjelger cjelger merged commit 9938228 into master May 7, 2020
@cjelger cjelger deleted the CIF-1300 branch May 7, 2020 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants