Search in sources :

Example 16 with Result

use of com.buschmais.jqassistant.core.report.api.model.Result in project jqa-core-framework by buschmais.

the class AnalyzerRuleVisitorTest method skipConcept.

@Test
void skipConcept() throws RuleException {
    analyzerRuleVisitor.skipConcept(concept, Severity.MAJOR);
    verify(store, never()).executeQuery(eq(statement), anyMap());
    verify(reportWriter).beginConcept(concept);
    ArgumentCaptor<Result> resultCaptor = ArgumentCaptor.forClass(Result.class);
    verify(reportWriter).setResult(resultCaptor.capture());
    Result result = resultCaptor.getValue();
    assertThat(result.getStatus(), equalTo(Result.Status.SKIPPED));
    assertThat(result.getSeverity(), equalTo(Severity.MAJOR));
    verify(reportWriter).endConcept();
    verify(store, never()).create(ConceptDescriptor.class);
}
Also used : Result(com.buschmais.jqassistant.core.report.api.model.Result) Test(org.junit.jupiter.api.Test)

Aggregations

Result (com.buschmais.jqassistant.core.report.api.model.Result)16 Test (org.junit.jupiter.api.Test)12 Constraint (com.buschmais.jqassistant.core.rule.api.model.Constraint)7 StringContains.containsString (org.hamcrest.core.StringContains.containsString)6 Concept (com.buschmais.jqassistant.core.rule.api.model.Concept)4 RuleException (com.buschmais.jqassistant.core.rule.api.model.RuleException)3 Map (java.util.Map)3 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)3 Matchers.anyMap (org.mockito.Matchers.anyMap)3 CompositeObject (com.buschmais.xo.api.CompositeObject)2 ConceptDescriptor (com.buschmais.jqassistant.core.analysis.api.model.ConceptDescriptor)1 Status (com.buschmais.jqassistant.core.report.api.model.Result.Status)1 PackageDescriptor (com.buschmais.jqassistant.plugin.java.api.model.PackageDescriptor)1 A (com.buschmais.jqassistant.plugin.java.test.set.rules.dependency.packages.a.A)1 Query (com.buschmais.xo.api.Query)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1 ScriptEngine (javax.script.ScriptEngine)1