Skip to content

Conversation

@vkostromin94
Copy link
Contributor

When the response had an autoApproved status, Gson could not correctly parse the status on this method:

protected <T> T handleResponse(HttpResponse<String> response, Class<T> classOfT) {
        String responseBody = response.body();
        if (!String.valueOf(response.statusCode()).startsWith("2")) {
            throw new TestRunException(responseBody);
        }
        return gson.fromJson(responseBody, classOfT);
    }

This resulted in a further NPE in the method track.

@vkostromin94
Copy link
Contributor Author

vkostromin94 commented May 23, 2022

STR:

  1. Create a new project, enable the autoApprove feature
  2. Run a test on branch a (not base) with a new screenshot (with status new)
  3. Approve a new screenshot
  4. Run a test with the same screenshot in branch b

Actual result:

NPE in method track. Object testResultDTO contains status=null.

image

Copy link
Member

@pashidlos pashidlos left a comment

Choose a reason for hiding this comment

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

@vkostromin94 good catch!
could you also add test for this case?

@vkostromin94
Copy link
Contributor Author

@vkostromin94 good catch! could you also add test for this case?

No problem, done.

@vkostromin94 vkostromin94 requested a review from pashidlos May 25, 2022 19:45
Copy link
Member

@pashidlos pashidlos left a comment

Choose a reason for hiding this comment

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

LGTM!

@pashidlos pashidlos merged commit c599671 into Visual-Regression-Tracker:master May 26, 2022
@pashidlos
Copy link
Member

@vkostromin94 thank you for contribution!

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