use of org.kie.workbench.common.stunner.bpmn.backend.query.FindBpmnProcessIdsQuery in project kie-wb-common by kiegroup.
the class BpmnFileIndexerTest method getQueries.
protected Set<NamedQuery> getQueries() {
return new HashSet<NamedQuery>() {
{
add(new FindResourcesQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new DefaultResponseBuilder(ioService());
}
});
add(new FindAllChangeImpactQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new DefaultResponseBuilder(ioService());
}
});
add(new FindBpmnProcessIdsQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new FindBpmnProcessIdsQuery.BpmnProcessIdsResponseBuilder(ioService());
}
});
}
};
}
use of org.kie.workbench.common.stunner.bpmn.backend.query.FindBpmnProcessIdsQuery in project kie-wb-common by kiegroup.
the class FindBpmnProcessIdsQueryTest method findBpmnProcessIdsQueryTermsTest.
@Test
public void findBpmnProcessIdsQueryTermsTest() {
FindBpmnProcessIdsQuery query = new FindBpmnProcessIdsQuery();
Set<ValueIndexTerm> queryTerms = new HashSet<>();
try {
query.validateTerms(queryTerms);
fail("The required resources term is missing, but no exception was thrown.");
} catch (IllegalArgumentException iae) {
assertTrue("Incorrect error message: " + iae.getMessage(), iae.getMessage().contains("Expected 'ValueResourceIndexTerm' term was not found."));
}
queryTerms = new HashSet<>();
queryTerms.add(new ValueResourceIndexTerm("not-bpmn2-resources", ResourceType.JAVA));
try {
query.validateTerms(queryTerms);
fail("The required resources term is missing, but no exception was thrown.");
} catch (IllegalArgumentException iae) {
assertTrue("Incorrect error message: " + iae.getMessage(), iae.getMessage().contains(ERROR_MSG));
}
queryTerms = new HashSet<>();
queryTerms.add(new ValueResourceIndexTerm("*", ResourceType.BPMN2, ValueIndexTerm.TermSearchType.WILDCARD));
try {
query.validateTerms(queryTerms);
} catch (IllegalArgumentException iae) {
fail("The activation term is acceptable here, but an exception was thrown.");
}
}
Aggregations