Class AttributeConstraintInterceptorTest
java.lang.Object
de.hybris.platform.validation.interceptors.AttributeConstraintInterceptorTest
This test tests the AttributeConstraint preparer and validator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit()creating some dummy data.voidTesting preparer, descriptor is set, other attributes filled with dummy data.voidTesting Preparer with empty constraint.voidTesting validator where qualifier is only missing.voidTesting validator with an itemmodel which is ok.voidTest validator.voidTesting validator with incorrect pojo.voidTesting validator with a correct pojo.voidTesting validator with empty constraint.
-
Constructor Details
-
AttributeConstraintInterceptorTest
public AttributeConstraintInterceptorTest()
-
-
Method Details
-
init
public void init()creating some dummy data. -
testPreparerWithEmptyConstraint
Testing Preparer with empty constraint. Expect: nothing changes.- Throws:
InterceptorException
-
testPreparerWithAttributeDescriptorOnly
Testing preparer, descriptor is set, other attributes filled with dummy data. Expect: descriptor overwrites all other fields.- Throws:
InterceptorException
-
testValidatorWithNullAnnotation
public void testValidatorWithNullAnnotation()Testing validator with empty constraint. Expect: exception, annotation is not set. -
testValidatorItemModelOK
Testing validator with an itemmodel which is ok. Expect: nothing.- Throws:
InterceptorException
-
testValidatorPojoOk
Testing validator with a correct pojo. Expect: nothing happens.- Throws:
InterceptorException
-
testValidatorPojoFail2
Test validator. Pojo is ok, attribute qualifier exists, but it is all lower case. Expect: exception.- Throws:
InterceptorException
-
testValidatorPojoFails
Testing validator with incorrect pojo. Expect: exception- Throws:
InterceptorException
-
testValidatorEmptyQualifier
Testing validator where qualifier is only missing. Expect: exception- Throws:
InterceptorException
-