package gov.va.med.esr.voa.validator;

import org.springframework.validation.BindException;
import org.springframework.validation.ObjectError;

import gov.va.med.esr.common.util.AbstractCommonTestCase;

public abstract class VoaCommonTestCase extends AbstractCommonTestCase {

	// check if specified error is created.
	protected boolean contain(BindException errors, final String targetCode) {
		boolean test = false;
		for (Object iter : errors.getAllErrors()) {
			ObjectError error = (ObjectError) iter;
			String code = error.getCode();
			if (targetCode.equals(code)) {
				test = true;
			}
		}
		return test;
	}

}
