Tabnine Logo
DeploymentQuery.tenantIdIn
Code IndexAdd Tabnine to your IDE (free)

How to use
tenantIdIn
method
in
org.camunda.bpm.engine.repository.DeploymentQuery

Best Java code snippets using org.camunda.bpm.engine.repository.DeploymentQuery.tenantIdIn (Showing top 20 results out of 315)

origin: camunda/camunda-bpm-platform

public void testFailQueryByTenantIdNull() {
 try {
  repositoryService.createDeploymentQuery()
   .tenantIdIn((String) null);
  fail("expected exception");
 } catch (NullValueException e) {
 }
}
origin: camunda/camunda-bpm-platform

query.tenantIdIn(tenantIds.toArray(new String[tenantIds.size()]));
origin: camunda/camunda-bpm-platform

query.tenantIdIn(tenantIds.toArray(new String[tenantIds.size()]));
origin: camunda/camunda-bpm-platform

public void testQueryByTenantId() {
 DeploymentQuery query = repositoryService
   .createDeploymentQuery()
   .tenantIdIn(TENANT_ONE);
 assertThat(query.count(), is(1L));
 query = repositoryService
   .createDeploymentQuery()
   .tenantIdIn(TENANT_TWO);
 assertThat(query.count(), is(1L));
}
origin: camunda/camunda-bpm-platform

public void testQueryByNonExistingTenantId() {
 DeploymentQuery query = repositoryService
   .createDeploymentQuery()
   .tenantIdIn("nonExisting");
 assertThat(query.count(), is(0L));
}
origin: camunda/camunda-bpm-platform

public void testQueryByTenantIds() {
 DeploymentQuery query = repositoryService
   .createDeploymentQuery()
   .tenantIdIn(TENANT_ONE, TENANT_TWO);
 assertThat(query.count(), is(2L));
}
origin: camunda/camunda-bpm-platform

public void testQueryAuthenticatedTenant() {
 identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
 DeploymentQuery query = repositoryService.createDeploymentQuery();
 assertThat(query.count(), is(2L));
 assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
 assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
 assertThat(query.tenantIdIn(TENANT_ONE, TENANT_TWO).includeDeploymentsWithoutTenantId().count(), is(2L));
}
origin: camunda/camunda-bpm-platform

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));
}
origin: camunda/camunda-bpm-platform

public void testQuerySortingAsc() {
 // exclude deployments without tenant id because of database-specific ordering
 List<Deployment> deployments = repositoryService.createDeploymentQuery()
   .tenantIdIn(TENANT_ONE, TENANT_TWO)
   .orderByTenantId()
   .asc()
   .list();
 assertThat(deployments.size(), is(2));
 assertThat(deployments.get(0).getTenantId(), is(TENANT_ONE));
 assertThat(deployments.get(1).getTenantId(), is(TENANT_TWO));
}
origin: camunda/camunda-bpm-platform

public void testQuerySortingDesc() {
 // exclude deployments without tenant id because of database-specific ordering
 List<Deployment> deployments = repositoryService.createDeploymentQuery()
   .tenantIdIn(TENANT_ONE, TENANT_TWO)
   .orderByTenantId()
   .desc()
   .list();
 assertThat(deployments.size(), is(2));
 assertThat(deployments.get(0).getTenantId(), is(TENANT_TWO));
 assertThat(deployments.get(1).getTenantId(), is(TENANT_ONE));
}
origin: camunda/camunda-bpm-platform

public void testQueryByTenantIdsIncludeDeploymentsWithoutTenantId() {
 DeploymentQuery query = repositoryService
   .createDeploymentQuery()
   .tenantIdIn(TENANT_ONE)
   .includeDeploymentsWithoutTenantId();
 assertThat(query.count(), is(2L));
 query = repositoryService
   .createDeploymentQuery()
   .tenantIdIn(TENANT_TWO)
   .includeDeploymentsWithoutTenantId();
 assertThat(query.count(), is(2L));
 query = repositoryService
   .createDeploymentQuery()
   .tenantIdIn(TENANT_ONE, TENANT_TWO)
   .includeDeploymentsWithoutTenantId();
 assertThat(query.count(), is(3L));
}
origin: camunda/camunda-bpm-platform

@Test
public void deleteDeploymentWithAuthenticatedTenant() {
 Deployment deployment = testRule.deployForTenant(TENANT_ONE, emptyProcess);
 identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
 repositoryService.deleteDeployment(deployment.getId());
 identityService.clearAuthentication();
 DeploymentQuery query = repositoryService.createDeploymentQuery();
 assertThat(query.count(), is(0L));
 assertThat(query.tenantIdIn(TENANT_ONE).count(), is(0L));
}
origin: camunda/camunda-bpm-platform

@Test
public void deleteDeploymentDisabledTenantCheck() {
 Deployment deploymentOne = testRule.deployForTenant(TENANT_ONE, emptyProcess);
 Deployment deploymentTwo = testRule.deployForTenant(TENANT_TWO, startEndProcess);
 processEngineConfiguration.setTenantCheckEnabled(false);
 identityService.setAuthentication("user", null, null);
 repositoryService.deleteDeployment(deploymentOne.getId());
 repositoryService.deleteDeployment(deploymentTwo.getId());
 DeploymentQuery query = repositoryService.createDeploymentQuery();
 assertThat(query.count(), is(0L));
 assertThat(query.tenantIdIn(TENANT_ONE).count(), is(0L));
 assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
}
origin: camunda/camunda-bpm-platform

@Test
public void createDeploymentWithAuthenticatedTenant() {
 identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
 repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess)
  .tenantId(TENANT_ONE).deploy();
 identityService.clearAuthentication();
 DeploymentQuery query = repositoryService.createDeploymentQuery();
 assertThat(query.count(), is(1L));
 assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
}
origin: camunda/camunda-bpm-platform

@Test
public void createDeploymentDisabledTenantCheck() {
 processEngineConfiguration.setTenantCheckEnabled(false);
 identityService.setAuthentication("user", null, null);
 repositoryService.createDeployment().addModelInstance("emptyProcessOne", emptyProcess).tenantId(TENANT_ONE).deploy();
 repositoryService.createDeployment().addModelInstance("emptyProcessTwo", startEndProcess).tenantId(TENANT_TWO).deploy();
 DeploymentQuery query = repositoryService.createDeploymentQuery();
 assertThat(query.count(), is(2L));
 assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
 assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
origin: camunda/camunda-bpm-platform

@Test
public void createDeploymentForAnotherTenant() {
 identityService.setAuthentication("user", null, null);
 repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess)
  .tenantId(TENANT_ONE).deploy();
 identityService.clearAuthentication();
 DeploymentQuery query = repositoryService.createDeploymentQuery();
 assertThat(query.count(), is(1L));
 assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
}
origin: camunda/camunda-bpm-platform

@Test
public void redeployForDifferentAuthenticatedTenantsDisabledTenantCheck() {
 Deployment deploymentOne = repositoryService.createDeployment()
  .addModelInstance("emptyProcess.bpmn", emptyProcess)
  .addModelInstance("startEndProcess.bpmn", startEndProcess)
  .tenantId(TENANT_ONE)
  .deploy();
 identityService.setAuthentication("user", null, null);
 processEngineConfiguration.setTenantCheckEnabled(false);
 repositoryService.createDeployment()
   .addDeploymentResources(deploymentOne.getId())
   .tenantId(TENANT_TWO)
   .deploy();
 DeploymentQuery query = repositoryService.createDeploymentQuery();
 assertThat(query.count(), is(2L));
 assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
 assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
origin: camunda/camunda-bpm-platform

@Test
public void redeployForTheSameAuthenticatedTenant() {
 Deployment deploymentOne = repositoryService.createDeployment()
  .addModelInstance("emptyProcess.bpmn", emptyProcess)
  .addModelInstance("startEndProcess.bpmn", startEndProcess)
  .tenantId(TENANT_ONE)
  .deploy();
 identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
 repositoryService.createDeployment()
   .addDeploymentResources(deploymentOne.getId())
   .tenantId(TENANT_ONE)
   .deploy();
 DeploymentQuery query = repositoryService.createDeploymentQuery();
 assertThat(query.count(), is(2L));
 assertThat(query.tenantIdIn(TENANT_ONE).count(), is(2L));
}
origin: camunda/camunda-bpm-platform

@Test
public void testDeploymentTenantIdIncludeDefinitionsWithoutTenantid() {
 List<Deployment> mockDeployments = Arrays.asList(
   MockProvider.createMockDeployment(null),
   MockProvider.createMockDeployment(MockProvider.EXAMPLE_TENANT_ID));
 mockedQuery = setUpMockDeploymentQuery(mockDeployments);
 Response response = given()
  .queryParam("tenantIdIn", MockProvider.EXAMPLE_TENANT_ID)
  .queryParam("includeDeploymentsWithoutTenantId", true)
 .then().expect()
  .statusCode(Status.OK.getStatusCode())
 .when()
  .get(DEPLOYMENT_QUERY_URL);
 verify(mockedQuery).tenantIdIn(MockProvider.EXAMPLE_TENANT_ID);
 verify(mockedQuery).includeDeploymentsWithoutTenantId();
 verify(mockedQuery).list();
 String content = response.asString();
 List<String> definitions = from(content).getList("");
 assertThat(definitions).hasSize(2);
 String returnedTenantId1 = from(content).getString("[0].tenantId");
 String returnedTenantId2 = from(content).getString("[1].tenantId");
 assertThat(returnedTenantId1).isEqualTo(null);
 assertThat(returnedTenantId2).isEqualTo(MockProvider.EXAMPLE_TENANT_ID);
}
origin: camunda/camunda-bpm-platform

@Test
public void testDeploymentTenantIdList() {
 List<Deployment> deployments = Arrays.asList(
   MockProvider.createMockDeployment(MockProvider.EXAMPLE_TENANT_ID),
   MockProvider.createMockDeployment(MockProvider.ANOTHER_EXAMPLE_TENANT_ID));
 mockedQuery = setUpMockDeploymentQuery(deployments);
 Response response = given()
  .queryParam("tenantIdIn", MockProvider.EXAMPLE_TENANT_ID_LIST)
 .then().expect()
  .statusCode(Status.OK.getStatusCode())
 .when()
  .get(DEPLOYMENT_QUERY_URL);
 verify(mockedQuery).tenantIdIn(MockProvider.EXAMPLE_TENANT_ID, MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
 verify(mockedQuery).list();
 String content = response.asString();
 List<String> definitions = from(content).getList("");
 assertThat(definitions).hasSize(2);
 String returnedTenantId1 = from(content).getString("[0].tenantId");
 String returnedTenantId2 = from(content).getString("[1].tenantId");
 assertThat(returnedTenantId1).isEqualTo(MockProvider.EXAMPLE_TENANT_ID);
 assertThat(returnedTenantId2).isEqualTo(MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
}
org.camunda.bpm.engine.repositoryDeploymentQuerytenantIdIn

Javadoc

Only select deployments with one of the given tenant ids.

Popular methods of DeploymentQuery

  • list
  • singleResult
  • count
  • deploymentId
    Only select deployments with the given deployment id.
  • deploymentName
    Only select deployments with the given name.
  • deploymentAfter
    Only select deployments deployed after the given date
  • deploymentBefore
    Only select deployments deployed before the given date
  • deploymentNameLike
    Only select deployments with a name like the given string.
  • deploymentSource
    If the given source is null, then deployments are returned where source is equal to null. Otherwise
  • includeDeploymentsWithoutTenantId
    Select deployments which have no tenant id. Can be used in combination with #tenantIdIn(String...).
  • orderByDeploymentId
    Order by deployment id (needs to be followed by #asc() or #desc()).
  • orderByDeploymentName
    Order by deployment name (needs to be followed by #asc() or #desc()).
  • orderByDeploymentId,
  • orderByDeploymentName,
  • orderByDeploymentTime,
  • orderByTenantId,
  • withoutTenantId,
  • listPage,
  • asc,
  • desc,
  • orderByDeploymenTime

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • putExtra (Intent)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JFileChooser (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now