public void testQueryWithoutTenantId() { DeploymentQuery query = repositoryService .createDeploymentQuery() .withoutTenantId(); assertThat(query.count(), is(1L)); }
public void testQueryAuthenticatedTenants() { identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO)); DeploymentQuery query = repositoryService.createDeploymentQuery(); assertThat(query.count(), is(3L)); assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L)); assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L)); assertThat(query.withoutTenantId().count(), is(1L)); }
@Test public void testDeploymentWithoutTenantId() { Deployment mockDeployment = MockProvider.createMockDeployment(null); mockedQuery = setUpMockDeploymentQuery(Collections.singletonList(mockDeployment)); Response response = given() .queryParam("withoutTenantId", true) .then().expect() .statusCode(Status.OK.getStatusCode()) .when() .get(DEPLOYMENT_QUERY_URL); verify(mockedQuery).withoutTenantId(); verify(mockedQuery).list(); String content = response.asString(); List<String> definitions = from(content).getList(""); assertThat(definitions).hasSize(1); String returnedTenantId1 = from(content).getString("[0].tenantId"); assertThat(returnedTenantId1).isEqualTo(null); }
public void testQueryWithoutTenantId() { DeploymentQuery query = repositoryService .createDeploymentQuery() .withoutTenantId(); assertThat(query.count(), is(1L)); }
public void testQueryAuthenticatedTenants() { identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO)); DeploymentQuery query = repositoryService.createDeploymentQuery(); assertThat(query.count(), is(3L)); assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L)); assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L)); assertThat(query.withoutTenantId().count(), is(1L)); }