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

Added IT test for numeric value prefix, postfix, infix, and in operators #1908

Merged
merged 2 commits into from
Mar 16, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,64 @@ void testPublishDateGreaterThanFilter() throws JsonProcessingException {
}
}

@Test
void testPublishDateEqualsFilter() throws JsonProcessingException {
/* Test Default */
JsonNode result = getAsNode("/book?filter[book.publishDate][in]=0,1454638927412");

assertEquals(8, result.get("data").size());

/* Test RSQL Typed */
result = getAsNode("/book?filter[book]=publishDate=in=(0,1454638927412)");

assertEquals(result.get("data").size(), 8);
}

@Test
void testPublishDatePrefixFilter() throws JsonProcessingException {
/* Test Default */
/* publish date = 1454638927412 */
JsonNode result = getAsNode("/book?filter[book.publishDate][prefix]=1");

assertEquals(1, result.get("data").size());

/* Test RSQL Typed */
/* publish date = 1454638927412 */
result = getAsNode("/book?filter[book]=publishDate==1*");

assertEquals(result.get("data").size(), 1);
}

@Test
void testPublishDateInfixFilter() throws JsonProcessingException {
/* Test Default */
/* publish date = 1454638927412 */
JsonNode result = getAsNode("/book?filter[book.publishDate][infix]=389");

assertEquals(1, result.get("data").size());

/* Test RSQL Typed */
/* publish date = 1454638927412 */
result = getAsNode("/book?filter[book]=publishDate==*389*");

assertEquals(result.get("data").size(), 1);
}

@Test
void testPublishDatePostfixFilter() throws JsonProcessingException {
/* Test Default */
/* publish date = 1454638927412 */
JsonNode result = getAsNode("/book?filter[book.publishDate][postfix]=412");

assertEquals(1, result.get("data").size());

/* Test RSQL Typed */
/* publish date = 1454638927412 */
result = getAsNode("/book?filter[book]=publishDate==*412");

assertEquals(result.get("data").size(), 1);
}

@Test
void testPublishDateGreaterThanFilterSubRecord() throws JsonProcessingException {
long publishDate;
Expand Down