public virtual void testInvalidUsageOfLatest() { DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery(); try { query.decisionDefinitionId("test").latestVersion().list(); fail(); } catch (NotValidException) { // Expected exception } try { query.decisionDefinitionName("test").latestVersion().list(); fail(); } catch (NotValidException) { // Expected exception } try { query.decisionDefinitionNameLike("test").latestVersion().list(); fail(); } catch (NotValidException) { // Expected exception } try { query.decisionDefinitionVersion(1).latestVersion().list(); fail(); } catch (NotValidException) { // Expected exception } try { query.deploymentId("test").latestVersion().list(); fail(); } catch (NotValidException) { // Expected exception } }