@Test
void validateWithDuplicateEnumName() {

    validator.beanClassNameValidator.beanClasses.put(Classes.className(TestBean.TestEnum.class), Void.class);
    assertThatThrownBy(() -> validator.validate(TestBean.class))
            .isInstanceOf(Error.class)
            .hasMessageContaining("found bean class with duplicate name which can be confusing");
}