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

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

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

origin: camunda/camunda-bpm-platform

private void createDeploymentMock() {
 Deployment mockDeployment = MockProvider.createMockDeployment();
 DeploymentQuery deploymentQueryMock = mock(DeploymentQuery.class);
 when(deploymentQueryMock.deploymentId(anyString())).thenReturn(deploymentQueryMock);
 when(deploymentQueryMock.singleResult()).thenReturn(mockDeployment);
 when(mockRepoService.createDeploymentQuery()).thenReturn(deploymentQueryMock);
}
origin: camunda/camunda-bpm-platform

public DeploymentDto getDeployment() {
 RepositoryService repositoryService = getProcessEngine().getRepositoryService();
 Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
 if (deployment == null) {
  throw new InvalidRequestException(Status.NOT_FOUND, "Deployment with id '" + deploymentId + "' does not exist");
 }
 return DeploymentDto.fromDeployment(deployment);
}
origin: camunda/camunda-bpm-platform

@Test
public void deploymentWithoutTenantId() {
 createDeploymentBuilder()
  .deploy();
 Deployment deployment = repositoryService
   .createDeploymentQuery()
   .singleResult();
 assertThat(deployment, is(notNullValue()));
 assertThat(deployment.getTenantId(), is(nullValue()));
}
origin: camunda/camunda-bpm-platform

@Test
public void testGetNonExistingSingleDeployment() {
 when(mockDeploymentQuery.deploymentId(NON_EXISTING_DEPLOYMENT_ID)).thenReturn(mockDeploymentQuery);
 when(mockDeploymentQuery.singleResult()).thenReturn(null);
 given().pathParam("id", NON_EXISTING_DEPLOYMENT_ID)
  .then().expect().statusCode(Status.NOT_FOUND.getStatusCode())
   .body(containsString("Deployment with id '" + NON_EXISTING_DEPLOYMENT_ID + "' does not exist"))
  .when().get(DEPLOYMENT_URL);
}
origin: camunda/camunda-bpm-platform

@Test
public void deploymentWithTenantId() {
 createDeploymentBuilder()
  .tenantId(TENANT_ONE)
  .deploy();
 Deployment deployment = repositoryService
   .createDeploymentQuery()
   .singleResult();
 assertThat(deployment, is(notNullValue()));
 assertThat(deployment.getTenantId(), is(TENANT_ONE));
}
origin: camunda/camunda-bpm-platform

@Override
public void deleteDeployment(String deploymentId, UriInfo uriInfo) {
 RepositoryService repositoryService = getProcessEngine().getRepositoryService();
 Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
 if (deployment == null) {
  throw new InvalidRequestException(Status.NOT_FOUND, "Deployment with id '" + deploymentId + "' do not exist");
 }
 boolean cascade = isQueryPropertyEnabled(uriInfo, CASCADE);
 boolean skipCustomListeners = isQueryPropertyEnabled(uriInfo, "skipCustomListeners");
 boolean skipIoMappings = isQueryPropertyEnabled(uriInfo, "skipIoMappings");
 repositoryService.deleteDeployment(deploymentId, cascade, skipCustomListeners, skipIoMappings);
}
origin: camunda/camunda-bpm-platform

@Override
public void deleteDeployment(String deploymentId, UriInfo uriInfo) {
 RepositoryService repositoryService = getProcessEngine().getRepositoryService();
 Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
 if (deployment == null) {
  throw new InvalidRequestException(Status.NOT_FOUND, "Deployment with id '" + deploymentId + "' do not exist");
 }
 boolean cascade = isQueryPropertyEnabled(uriInfo, CASCADE);
 boolean skipCustomListeners = isQueryPropertyEnabled(uriInfo, "skipCustomListeners");
 boolean skipIoMappings = isQueryPropertyEnabled(uriInfo, "skipIoMappings");
 repositoryService.deleteDeployment(deploymentId, cascade, skipCustomListeners, skipIoMappings);
}
origin: camunda/camunda-bpm-platform

public void testQueryByName() {
 DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentName("org/camunda/bpm/engine/test/repository/two_.bpmn20.xml");
 assertNotNull(query.singleResult());
 assertEquals(1, query.list().size());
 assertEquals(1, query.count());
}
origin: camunda/camunda-bpm-platform

public void testQueryByDeploymentId() {
 DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentId(deploymentOneId);
 assertNotNull(query.singleResult());
 assertEquals(1, query.list().size());
 assertEquals(1, query.count());
}
origin: camunda/camunda-bpm-platform

protected void unregisterProcessApplication() {
 org.camunda.bpm.engine.repository.Deployment deployment =
  engine1.getRepositoryService().createDeploymentQuery().singleResult();
 engine1.getManagementService().unregisterProcessApplication(deployment.getId(), false);
}
origin: camunda/camunda-bpm-platform

public void testQueryByInvalidDeploymentId() {
 DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentId("invalid");
 assertNull(query.singleResult());
 assertEquals(0, query.list().size());
 assertEquals(0, query.count());
 try {
  repositoryService.createDeploymentQuery().deploymentId(null);
  fail();
 } catch (ProcessEngineException e) {}
}
origin: camunda/camunda-bpm-platform

public void testEmptyCamundaInTargetWithoutValidation() {
 try {
  processEngineConfiguration.setDisableStrictCallActivityValidation(true);
  String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testEmptyCamundaInTargetThrowsError");
  repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy();
 } finally {
  processEngineConfiguration.setDisableStrictCallActivityValidation(false);
  repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true);
 }
}
origin: camunda/camunda-bpm-platform

public void testQueryByInvalidNameLike() {
 DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentNameLike("invalid");
 assertNull(query.singleResult());
 assertEquals(0, query.list().size());
 assertEquals(0, query.count());
 try {
  repositoryService.createDeploymentQuery().deploymentNameLike(null);
  fail();
 } catch (ProcessEngineException e) {}
}
origin: camunda/camunda-bpm-platform

public void testEmptyCamundaOutSourceWithoutValidation() {
 try {
  processEngineConfiguration.setDisableStrictCallActivityValidation(true);
  String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testEmptyCamundaOutSourceThrowsError");
  repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy();
 } finally {
  processEngineConfiguration.setDisableStrictCallActivityValidation(false);
  repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true);
 }
}
origin: camunda/camunda-bpm-platform

protected void assertProcessDeployed(String processKey, String expectedDeploymentName) {
 
 ProcessDefinition processDefinition = repositoryService
   .createProcessDefinitionQuery()
   .latestVersion()
   .processDefinitionKey(processKey)
   .singleResult();    
 
 DeploymentQuery deploymentQuery = repositoryService
   .createDeploymentQuery()
   .deploymentId(processDefinition.getDeploymentId());
 
 Assert.assertEquals(expectedDeploymentName, deploymentQuery.singleResult().getName());
 
}

origin: camunda/camunda-bpm-platform

protected void assertProcessDeployed(String processKey, String expectedDeploymentName) {
 
 ProcessDefinition processDefinition = repositoryService
   .createProcessDefinitionQuery()
   .latestVersion()
   .processDefinitionKey(processKey)
   .singleResult();    
 
 DeploymentQuery deploymentQuery = repositoryService
   .createDeploymentQuery()
   .deploymentId(processDefinition.getDeploymentId());
 
 Assert.assertEquals(expectedDeploymentName, deploymentQuery.singleResult().getName());
 
}

origin: camunda/camunda-bpm-platform

protected void assertProcessDeployed(String processKey, String expectedDeploymentName) {
 
 ProcessDefinition processDefinition = repositoryService
   .createProcessDefinitionQuery()
   .latestVersion()
   .processDefinitionKey(processKey)
   .singleResult();    
 
 DeploymentQuery deploymentQuery = repositoryService
   .createDeploymentQuery()
   .deploymentId(processDefinition.getDeploymentId());
 
 Assert.assertEquals(expectedDeploymentName, deploymentQuery.singleResult().getName());
 
}
origin: camunda/camunda-bpm-platform

public void testParseWithMultipleDocumentation() {
 repositoryService.createDeployment()
   .addClasspathResource("org/camunda/bpm/engine/test/bpmn/parse/BpmnParseTest.testParseWithMultipleDocumentation.bpmn20.xml").deploy();
 assertEquals(1, repositoryService.createProcessDefinitionQuery().count());
 repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true);
}
origin: camunda/camunda-bpm-platform

public void testParseCollaborationPlane() {
 repositoryService.createDeployment().addClasspathResource("org/camunda/bpm/engine/test/bpmn/parse/BpmnParseTest.testParseCollaborationPlane.bpmn").deploy();
 assertEquals(1, repositoryService.createProcessDefinitionQuery().count());
 repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true);
}
origin: camunda/camunda-bpm-platform

public void testDefaultDeploymentSource() {
 String key = "process";
 BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();
 DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
 Deployment deployment = repositoryService
   .createDeployment(processApplication.getReference())
   .name("first-deployment-with-a-source")
   .addModelInstance("process.bpmn", model)
   .deploy();
 assertEquals(ProcessApplicationDeployment.PROCESS_APPLICATION_DEPLOYMENT_SOURCE, deploymentQuery.deploymentName("first-deployment-with-a-source").singleResult().getSource());
 deleteDeployments(deployment);
}
org.camunda.bpm.engine.repositoryDeploymentQuerysingleResult

Popular methods of DeploymentQuery

  • list
  • 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()).
  • orderByDeploymentTime
    Order by deployment time (needs to be followed by #asc() or #desc()).
  • orderByDeploymentName,
  • orderByDeploymentTime,
  • orderByTenantId,
  • tenantIdIn,
  • withoutTenantId,
  • listPage,
  • asc,
  • desc,
  • orderByDeploymenTime

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • Kernel (java.awt.image)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Table (org.hibernate.mapping)
    A relational table
  • Top Vim 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