use of com.auth0.client.mgmt.filter.ActionsFilter in project auth0-java by auth0.
the class ActionsEntityTest method shouldListActionsWithFilter.
@Test
public void shouldListActionsWithFilter() throws Exception {
ActionsFilter filter = new ActionsFilter().withActionName("action-name").withDeployed(true).withInstalled(false).withTriggerId("post-login").withPage(1, 10);
Request<ActionsPage> request = api.actions().list(filter);
assertThat(request, is(notNullValue()));
server.jsonResponse(MockServer.ACTIONS_LIST, 200);
ActionsPage response = request.execute();
RecordedRequest recordedRequest = server.takeRequest();
assertThat(recordedRequest, hasMethodAndPath("GET", "/api/v2/actions/actions"));
assertThat(recordedRequest, hasQueryParameter("actionName", "action-name"));
assertThat(recordedRequest, hasQueryParameter("deployed", "true"));
assertThat(recordedRequest, hasQueryParameter("installed", "false"));
assertThat(recordedRequest, hasQueryParameter("triggerId", "post-login"));
assertThat(recordedRequest, hasQueryParameter("page", "1"));
assertThat(recordedRequest, hasQueryParameter("per_page", "10"));
assertThat(recordedRequest, hasHeader("Content-Type", "application/json"));
assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken"));
assertThat(response, is(notNullValue()));
}
Aggregations