-
Notifications
You must be signed in to change notification settings - Fork 55
SLCORE-1550 Use ServerFixture for BindingSuggestionsMediumTests #1443
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
base: master
Are you sure you want to change the base?
SLCORE-1550 Use ServerFixture for BindingSuggestionsMediumTests #1443
Conversation
a250733
to
41132cd
Compare
41132cd
to
78d522f
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments to improve it even further
@@ -359,6 +354,9 @@ void should_suggest_binding_by_remote_url_when_no_other_suggestions_found(SonarL | |||
var scServer = harness.newFakeSonarCloudServer() | |||
.withOrganization("orgKey", organization -> | |||
organization.withProject(SLCORE_PROJECT_KEY, project -> project.withBranch("main"))) | |||
.withDopTranslation(dop -> dop | |||
.withProjectBinding(REMOTE_URL, PROJECT_ID, SLCORE_PROJECT_KEY) | |||
.withSearchProjectsResponse("orgKey", PROJECT_ID, 200, "{\"components\":[{\"key\":\"" + SLCORE_PROJECT_KEY + "\",\"name\":\"" + SLCORE_PROJECT_NAME + "\"}]}\n")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do this slightly differently. I think withDopTranslation
and withProjectBinding
are good, but I would remove withSearchProjectsResponse
. Just above, there is already a call to organization.withProject
, you could make sure this call registers a response to api/components/search_projects
. You can also modify the project builder to add a withName
. This would make the test even less verbose
medium-tests/src/test/java/mediumtest/BindingSuggestionsMediumTests.java
Show resolved
Hide resolved
@@ -619,24 +552,16 @@ void should_return_empty_when_sqs_server_project_is_not_present(SonarLintTestHar | |||
|
|||
var sqServer = harness.newFakeSonarQubeServer() | |||
.withProject(SLCORE_PROJECT_KEY, project -> project.withBranch("main")) | |||
.withDopTranslation(dop -> dop | |||
.withProjectBinding(REMOTE_URL, PROJECT_ID, SLCORE_PROJECT_KEY) | |||
.withComponentShowStatus(SLCORE_PROJECT_KEY, 404, "Project not found")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
SLCORE-1550