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

Fix WebAPI issues #469

Merged
merged 14 commits into from
Feb 20, 2019
Merged

Fix WebAPI issues #469

merged 14 commits into from
Feb 20, 2019

Conversation

wblachowski
Copy link
Contributor

I fixed some inconsistencies in WebAPI responses and provided more meaningful 404 messages.

Closes #425

Description

Issues addressed:

  1. Get artifact by artifactId for wrong artifactId:
    http://aet-vagrant:8181/api/artifact?company=company&project=project&id=99999999
  • Old response:
    500
  • New response:
    404
    {
    "message": "Unable to get artifact with id: 99999999 for {company='company', project='project'}"
    }
  1. Get metadata for wrong correlationId
    http://aet-vagrant:8181/api/artifact?company=company&project=project&id=99999999
  • Old response:
    400
    {
    "message": "Unable to get Suite Metadata for {company='company', project='project'}"
    {
  • New response:
    404
    {
    "message": "Unable to get Suite Metadata with correlationId: 99999999 for {company='company', project='project'}"
    }
  1. Get metadata for wrong suite name
    http://aet-vagrant:8181/api/metadata?company=company&project=project&suite=no_existing_suite
  • Old response:
    400
    {
    "message": "Unable to get Suite Metadata for {company='company', project='project'}"
    }
  • New response:
    404
    {
    "message": "Unable to get Suite Metadata with suite name: no_existing_suite for {company='company', project='project'}"
    }
  1. Get metadata by suite name and wrong version
    http://aet-vagrant:8181/api/metadata?company=company&project=project&suite=test-suite&version=999
  • Old response:
    400
    {
    "message": "Unable to get Suite Metadata for {company='company', project='project'}"
    }
  • New response:
    404
    {
    "message": "Unable to get Suite Metadata with suite name: test-suite, version: 999 for {company='company', project='project'}"
    }
  1. Get locked suites
    http://aet-vagrant:8181/configs/locks
  • Old response:
    {
    company-project-test-suite=company-project-test-suite-1548143700186, 
    secondcompany-secondproject-test-suite2=secondcompany-secondproject-test-suite2-1548143698893
    }
  • New response:
    {
    "company-project-test-suite": "company-project-test-suite-1548141903906",
    "secondcompany-secondproject-test-suite2": "secondcompany-secondproject-test-suite2-1548141899754"
    }

Motivation and Context

Closes #425

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 not work as expected)

Checklist:

  • My code follows the code style of this project.
  • I have reviewed (and updated if needed) the documentation regarding this change

I hereby agree to the terms of the AET Contributor License Agreement.

CHANGELOG.md Outdated
@@ -25,6 +25,7 @@ All notable changes to AET will be documented in this file.
- [PR-404](https://github.com/Cognifide/aet/pull/404) Added missing tooltip for conditional tests
- [PR-408](https://github.com/Cognifide/aet/pull/408) Advanced Screen Comparision button layout fix
- [PR-410](https://github.com/Cognifide/aet/pull/410) Notification that displays when exclude-elements are not found on page now shows what specific elements were not found([#372](https://github.com/Cognifide/aet/issues/372))
- [PR-469](https://github.com/Cognifide/aet/pull/469) Fix WebAPI issues([#425](https://github.com/Cognifide/aet/issues/425))
Copy link

Choose a reason for hiding this comment

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

this should be in unreleased section

} else if (suiteName != null) {
paramsValuesMessage = String.format("suite name: %s", suiteName);
if (suiteVersion != null) {
paramsValuesMessage = String.format("%s, version: %s", paramsValuesMessage, suiteVersion);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is everything ok with formatting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks fine to me, these are nested if statements. It's OK according to Google Style

@bambroziak
Copy link

Tested and accepted.
I've rebuilded Integration with changes and checked responses - all of them were new ones.

QA Covered.

@tkaik tkaik merged commit 3ebd6f2 into wttech:master Feb 20, 2019
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.

WebAPI issueses
5 participants