	@Test
	public void nameTooShortOnUpdate() {


		try {
			Customer customer = new Customer("Bob");
			em.persist(customer);
			em.flush();

			em.detach(customer);
			customer.setName("Bo");
			em.merge(customer);
			em.flush();

			fail("Expected ConstraintViolationException wasn't thrown.");
		} catch (ConstraintViolationException e) {
			assertEquals(1, e.getConstraintViolations().size());
			ConstraintViolation<?> violation = e.getConstraintViolations()
					.iterator().next();
			assertEquals("name", violation.getPropertyPath().toString());
			assertEquals(Size.class, violation.getConstraintDescriptor()
					.getAnnotation().annotationType());
		}
	}