-
Notifications
You must be signed in to change notification settings - Fork 25
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
CIRC-2117 Return empty result when search doesn't find anything #1485
Conversation
ed6e028
to
82758f6
Compare
IndividualResource instance = instancesFixture.basedUponDunkirk(); | ||
UUID instanceId = instance.getId(); |
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.
can we inline it?
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.
You mean like this?
UUID instanceId = instancesFixture.basedUponDunkirk().getId();
Since we do not call instance object, we could do like this
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.
yes, you use this variable only once
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.
updated, thanks!
Response response = get(String.format("query=(id==%s)", instanceId), 200); | ||
JsonObject responseJson = response.getJson(); | ||
|
||
Assertions.assertTrue(responseJson.isEmpty()); |
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 suggest using the same import for assertions as seen throughout this test
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.
Thanks for noticing it, fix it
e16908b
to
d96c998
Compare
clearTempTenantId(); | ||
|
||
// make sure neither item exists in current tenant | ||
assertThat(itemsFixture.getById(collegeItem.getId()).getResponse().getStatusCode(), is(404)); |
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.
assertThat(itemsFixture.getById(collegeItem.getId()).getResponse().getStatusCode(), is(404)); | |
assertThat(itemsFixture.getById(collegeItem.getId()).getResponse().getStatusCode(), is(HttpStatus.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.
done
assertThat(itemsFixture.getById(universityItem.getId()).getResponse().getStatusCode(), is(404)); | ||
|
||
ResourceClient.forSearchClient().replace(instanceId, new JsonObject()); | ||
Response response = get(String.format("query=(id==%s)", instanceId), 200); |
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.
Response response = get(String.format("query=(id==%s)", instanceId), 200); | |
Response response = get(String.format("query=(id==%s)", instanceId), HttpStatus.HTTP_OK); |
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.
done
assertThat(itemsFixture.getById(collegeItem.getId()).getResponse().getStatusCode(), is(HttpStatus.HTTP_NOT_FOUND.toInt())); | ||
assertThat(itemsFixture.getById(universityItem.getId()).getResponse().getStatusCode(), is(HttpStatus.HTTP_NOT_FOUND.toInt())); |
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.
assertThat(itemsFixture.getById(collegeItem.getId()).getResponse().getStatusCode(), is(HttpStatus.HTTP_NOT_FOUND.toInt())); | |
assertThat(itemsFixture.getById(universityItem.getId()).getResponse().getStatusCode(), is(HttpStatus.HTTP_NOT_FOUND.toInt())); | |
assertThat(itemsFixture.getById(collegeItem.getId()).getResponse().getStatusCode(), | |
is(HTTP_NOT_FOUND.toInt())); | |
assertThat(itemsFixture.getById(universityItem.getId()).getResponse().getStatusCode(), | |
is(HTTP_NOT_FOUND.toInt())); |
assertThat(itemsFixture.getById(universityItem.getId()).getResponse().getStatusCode(), is(HttpStatus.HTTP_NOT_FOUND.toInt())); | ||
|
||
ResourceClient.forSearchClient().replace(instanceId, new JsonObject()); | ||
Response response = get(String.format("query=(id==%s)", instanceId), HttpStatus.HTTP_OK.toInt()); |
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.
Response response = get(String.format("query=(id==%s)", instanceId), HttpStatus.HTTP_OK.toInt()); | |
Response response = get(String.format("query=(id==%s)", instanceId), HTTP_OK.toInt()); |
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.
done
576bbb7
to
422ba2c
Compare
Quality Gate passedIssues Measures |
Purpose
Return empty result when search doesn't find anything
Learning
CIRC-2117