Class AttributeConstraintInterceptorTest
- java.lang.Object
-
- de.hybris.platform.validation.interceptors.AttributeConstraintInterceptorTest
-
@UnitTest public class AttributeConstraintInterceptorTest extends java.lang.Object
This test tests the AttributeConstraint preparer and validator.
-
-
Constructor Summary
Constructors Constructor Description AttributeConstraintInterceptorTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit()creating some dummy data.voidtestPreparerWithAttributeDescriptorOnly()Testing preparer, descriptor is set, other attributes filled with dummy data.voidtestPreparerWithEmptyConstraint()Testing Preparer with empty constraint.voidtestValidatorEmptyQualifier()Testing validator where qualifier is only missing.voidtestValidatorItemModelOK()Testing validator with an itemmodel which is ok.voidtestValidatorPojoFail2()Test validator.voidtestValidatorPojoFails()Testing validator with incorrect pojo.voidtestValidatorPojoOk()Testing validator with a correct pojo.voidtestValidatorWithNullAnnotation()Testing validator with empty constraint.
-
-
-
Method Detail
-
init
public void init()
creating some dummy data.
-
testPreparerWithEmptyConstraint
public void testPreparerWithEmptyConstraint() throws InterceptorExceptionTesting Preparer with empty constraint. Expect: nothing changes.- Throws:
InterceptorException
-
testPreparerWithAttributeDescriptorOnly
public void testPreparerWithAttributeDescriptorOnly() throws InterceptorExceptionTesting 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
public void testValidatorItemModelOK() throws InterceptorExceptionTesting validator with an itemmodel which is ok. Expect: nothing.- Throws:
InterceptorException
-
testValidatorPojoOk
public void testValidatorPojoOk() throws InterceptorExceptionTesting validator with a correct pojo. Expect: nothing happens.- Throws:
InterceptorException
-
testValidatorPojoFail2
public void testValidatorPojoFail2() throws InterceptorExceptionTest validator. Pojo is ok, attribute qualifier exists, but it is all lower case. Expect: exception.- Throws:
InterceptorException
-
testValidatorPojoFails
public void testValidatorPojoFails() throws InterceptorExceptionTesting validator with incorrect pojo. Expect: exception- Throws:
InterceptorException
-
testValidatorEmptyQualifier
public void testValidatorEmptyQualifier() throws InterceptorExceptionTesting validator where qualifier is only missing. Expect: exception- Throws:
InterceptorException
-
-