From 509d87fc197234b3ce998d5a8a592cc1de14e9a6 Mon Sep 17 00:00:00 2001 From: StephenOTT Date: Mon, 18 Mar 2019 17:33:49 -0400 Subject: [PATCH] Update tet for parser validation --- .../AttackPatternValidationSpec.groovy | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/test/groovy/stix/validation/AttackPatternValidationSpec.groovy b/src/test/groovy/stix/validation/AttackPatternValidationSpec.groovy index fa2b32f..c946208 100644 --- a/src/test/groovy/stix/validation/AttackPatternValidationSpec.groovy +++ b/src/test/groovy/stix/validation/AttackPatternValidationSpec.groovy @@ -75,21 +75,21 @@ class AttackPatternValidationSpec extends Specification { "xx_gats": "respondent persistently trephining anodizes washiest untimely jibe" } ''' + + then: "Should have 1 error" try { StixParsers.parseObject(json) } catch (StixParserValidationException ex) { - ex.getConstraintValidations().each { x -> - println "------" - println "Type: ${x.getRootBean().getClass().getSimpleName()}" - println "Message: ${x.getMessage()}" - println "path: ${x.getPropertyPath()}" - println "invalid_value: ${x.getInvalidValue().toString()}" - println "------" - } + assert ex.getConstraintValidations().size() == 1 + // ex.getConstraintValidations().each { x -> + // println "------" + // println "Type: ${x.getRootBean().getClass().getSimpleName()}" + // println "Message: ${x.getMessage()}" + // println "path: ${x.getPropertyPath()}" + // println "invalid_value: ${x.getInvalidValue().toString()}" + // println "------" + // } } - - then : "Should have 1 error" - println "DONE" -} + } }