use of com.auth0.client.mgmt.filter.FieldsFilter in project auth0-java by auth0.
the class OrganizationEntityTest method shouldGetInvitationWithFilter.
@Test
public void shouldGetInvitationWithFilter() throws Exception {
Request<Invitation> request = api.organizations().getInvitation("org_123", "invitation_id", new FieldsFilter().withFields("id,invitation_url,invitee", true));
assertThat(request, is(notNullValue()));
server.jsonResponse(INVITATION, 200);
Invitation response = request.execute();
RecordedRequest recordedRequest = server.takeRequest();
assertThat(recordedRequest, hasMethodAndPath("GET", "/api/v2/organizations/org_123/invitations/invitation_id"));
assertThat(recordedRequest, hasHeader("Content-Type", "application/json"));
assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken"));
assertThat(recordedRequest, hasQueryParameter("fields", "id,invitation_url,invitee"));
assertThat(recordedRequest, hasQueryParameter("include_fields", "true"));
assertThat(response, is(notNullValue()));
}
use of com.auth0.client.mgmt.filter.FieldsFilter in project auth0-java by auth0.
the class TenantsEntityTest method shouldGetTenantSettingsWithFields.
@Test
public void shouldGetTenantSettingsWithFields() throws Exception {
FieldsFilter filter = new FieldsFilter().withFields("some,random,fields", true);
Request<Tenant> request = api.tenants().get(filter);
assertThat(request, is(notNullValue()));
server.jsonResponse(MGMT_TENANT, 200);
Tenant response = request.execute();
RecordedRequest recordedRequest = server.takeRequest();
assertThat(recordedRequest, hasMethodAndPath("GET", "/api/v2/tenants/settings"));
assertThat(recordedRequest, hasHeader("Content-Type", "application/json"));
assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken"));
assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields"));
assertThat(recordedRequest, hasQueryParameter("include_fields", "true"));
assertThat(response, is(notNullValue()));
}
use of com.auth0.client.mgmt.filter.FieldsFilter in project auth0-java by auth0.
the class EmailProviderEntityTest method shouldGetEmailProviderWithFields.
@Test
public void shouldGetEmailProviderWithFields() throws Exception {
FieldsFilter filter = new FieldsFilter().withFields("some,random,fields", true);
Request<EmailProvider> request = api.emailProvider().get(filter);
assertThat(request, is(notNullValue()));
server.jsonResponse(MGMT_EMAIL_PROVIDER, 200);
EmailProvider response = request.execute();
RecordedRequest recordedRequest = server.takeRequest();
assertThat(recordedRequest, hasMethodAndPath("GET", "/api/v2/emails/provider"));
assertThat(recordedRequest, hasHeader("Content-Type", "application/json"));
assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken"));
assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields"));
assertThat(recordedRequest, hasQueryParameter("include_fields", "true"));
assertThat(response, is(notNullValue()));
}
use of com.auth0.client.mgmt.filter.FieldsFilter in project auth0-java by auth0.
the class UsersEntityTest method shouldListUsersByEmailWithFields.
@Test
public void shouldListUsersByEmailWithFields() throws Exception {
FieldsFilter filter = new FieldsFilter().withFields("some,random,fields", true);
Request<List<User>> request = api.users().listByEmail("johndoe@auth0.com", filter);
assertThat(request, is(notNullValue()));
server.jsonResponse(MGMT_USERS_LIST, 200);
List<User> response = request.execute();
RecordedRequest recordedRequest = server.takeRequest();
assertThat(recordedRequest, hasMethodAndPath("GET", "/api/v2/users-by-email"));
assertThat(recordedRequest, hasHeader("Content-Type", "application/json"));
assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken"));
assertThat(recordedRequest, hasQueryParameter("email", "johndoe@auth0.com"));
assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields"));
assertThat(recordedRequest, hasQueryParameter("include_fields", "true"));
assertThat(response, is(notNullValue()));
assertThat(response, hasSize(2));
}
Aggregations