/* * Tests that a change in the unit's active state triggers a warning message. Tests that the unitActive constraint * does not prevent the model from being saved. */ @Ignore public void changeInActiveStateTriggersWarningMessage() { // test warning triggered when changing active state to false final B2BUnitModel unit = b2bUnitService.getUnitForUid("GC Sales UK"); unit.setActive(Boolean.FALSE); modelService.save(unit); Set<HybrisConstraintViolation> constraintViolations = validationService.validate(unit); Assert.assertTrue(checkForB2BUnitActiveAnnotation(constraintViolations)); Assert.assertFalse(unit.getActive().booleanValue()); Assert.assertTrue(modelService.isUpToDate(unit)); // test warning triggered when changing active state to true unit.setActive(Boolean.TRUE); modelService.save(unit); constraintViolations = validationService.validate(unit); Assert.assertTrue(checkForB2BUnitActiveAnnotation(constraintViolations)); Assert.assertTrue(unit.getActive().booleanValue()); Assert.assertTrue(modelService.isUpToDate(unit)); }