@@ -0,0 +1,1838 @@
+package com.dreamchain.skeleton.model;%0A%0Aimport org.junit.Test;%0A%0Aimport javax.validation.ConstraintViolation;%0Aimport javax.validation.Validation;%0Aimport javax.validation.Validator;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport static org.junit.Assert.*;%0A%0A%0Apublic class CustomerTest %7B%0A%0A%0A    @Test%0A    public void assert_that_certain_fields_cant_be_null_or_blank() %7B%0A        Customer customer = new Customer();%0A        customer.setName(%22test%22);%0A        customer.setNid(%221234567890123%22);%0A        customer.setPhone(%2212345678901%22);%0A        customer.setAddress(%22ssfhshfhsdgfshgfh%22);%0A        customer.setEmail(%22babu313133@gmail.com%22);%0A        customer.setCustomerCode(%22TE0001%22);%0A%0A        Map%3CString, ConstraintViolation%3CCustomer%3E%3E violationsMap = validate(customer);%0A        assertTrue(violationsMap.size() == 0);%0A    %7D%0A%0A    @Test%0A    public void assert_that_email_has_to_be_an_email() %7B%0A        Customer customer = new Customer();%0A        customer.setName(%22test%22);%0A        customer.setNid(%221234567890123%22);%0A        customer.setPhone(%2212345678901%22);%0A        customer.setAddress(%22ssfhshfhsdgfshgfh%22);%0A        customer.setEmail(%22babu@yahoo.com%22);%0A        customer.setCustomerCode(%22TE0001%22);%0A%0A        Map%3CString, ConstraintViolation%3CCustomer%3E%3E violationsMap = validate(customer);%0A        assertTrue(violationsMap.get(%22email%22).getMessageTemplate().contains(%22Email%22));%0A    %7D%0A%0A%0A    private %3CT%3E Map%3CString, ConstraintViolation%3CT%3E%3E validate(T user) %7B%0A        Validator validator = Validation.buildDefaultValidatorFactory().getValidator();%0A        Map%3CString, ConstraintViolation%3CT%3E%3E violations = new HashMap%3CString, ConstraintViolation%3CT%3E%3E();%0A        for (ConstraintViolation%3CT%3E violation : validator.validate(user)) %7B%0A            violations.put(violation.getPropertyPath().toString(), violation);%0A        %7D%0A        return violations;%0A    %7D%0A%0A%7D%0A

Create order functionality