use of org.activiti.engine.repository.ModelQuery in project Activiti by Activiti.
the class ModelQueryTest method testModelProperties.
public void testModelProperties() {
ModelQuery query = repositoryService.createModelQuery();
Model model = query.singleResult();
assertThat(model.getId()).isNotNull();
assertThat(model.getCategory()).isNotNull();
assertThat(model.getKey()).isNotNull();
assertThat(model.getName()).isNotNull();
assertThat(model.getVersion()).isNotNull();
assertThat(model.getCreateTime()).isNotNull();
assertThat(model.getLastUpdateTime()).isNotNull();
}
use of org.activiti.engine.repository.ModelQuery in project Activiti by Activiti.
the class ModelQueryTest method testQueryByNameAndKey.
public void testQueryByNameAndKey() {
ModelQuery query = repositoryService.createModelQuery().modelKey("someKey");
Model model = query.singleResult();
assertThat(model).isNotNull();
assertThat(query.list()).hasSize(1);
assertThat(query.count()).isEqualTo(1);
}
use of org.activiti.engine.repository.ModelQuery in project Activiti by Activiti.
the class ModelQueryTest method testQueryByNameLike.
public void testQueryByNameLike() throws Exception {
ModelQuery query = repositoryService.createModelQuery().modelNameLike("%model%");
Model model = query.singleResult();
assertThat(model).isNotNull();
assertThat(new String(repositoryService.getModelEditorSource(model.getId()), "utf-8")).isEqualTo("bytes");
assertThat(query.list()).hasSize(1);
assertThat(query.count()).isEqualTo(1);
}
Aggregations