public virtual void testQueryByDeploymentId() { DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentId(deploymentOneId); assertNotNull(query.singleResult()); assertEquals(1, query.list().size()); assertEquals(1, query.count()); }
public virtual 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()); }
private void createDeploymentMock() { Deployment mockDeployment = MockProvider.createMockDeployment(); DeploymentQuery deploymentQueryMock = mock(typeof(DeploymentQuery)); when(deploymentQueryMock.deploymentId(anyString())).thenReturn(deploymentQueryMock); when(deploymentQueryMock.singleResult()).thenReturn(mockDeployment); when(mockRepoService.createDeploymentQuery()).thenReturn(deploymentQueryMock); }
public virtual void testQueryNoCriteria() { DeploymentQuery query = repositoryService.createDeploymentQuery(); assertEquals(2, query.list().size()); assertEquals(2, query.count()); try { query.singleResult(); fail(); } catch (ProcessEngineException) { } }
public virtual 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) { } }