### Question:
CoreTranslationMessages { public static String getBeanValidationMessage(final StunnerTranslationService translationService, final ModelBeanViolation violation) { return translationService.getValue(VALIDATION_PROPERTY, violation.getPropertyPath(), violation.getMessage()); }  static Optional<String> getDiagramValidationsErrorMessage(final StunnerTranslationService translationService,
                                                                     final Collection<DiagramElementViolation<RuleViolation>> result); static String getRuleValidationMessage(final StunnerTranslationService translationService,
                                                  final RuleViolation violation); static String getBeanValidationMessage(final StunnerTranslationService translationService,
                                                  final ModelBeanViolation violation); static String getDomainValidationMessage(final DomainViolation violation); static Optional<String> getElementValidationMessage(final StunnerTranslationService translationService,
                                                               final DiagramElementViolation<RuleViolation> elementViolation); static final String ERROR; static final String WARNING; static final String INFO; static final String REASON; static final String DELETE; static final String EDIT; static final String PRINT; static final String RESET; static final String INCREASE; static final String DECREASE; static final String FIT; static final String ARE_YOU_SURE; static final String COMMAND_SUCCESS; static final String COMMAND_FAILED; static final String VALIDATION_SUCCESS; static final String VALIDATION_PROPERTY; static final String ELEMENT; static final String VALIDATION_FAILED; static final String MEDIATOR_PREVIEW; static final String DIAGRAM_LOAD_FAIL_UNSUPPORTED_ELEMENTS; static final String DIAGRAM_AUTOMATIC_LAYOUT_PERFORMED; static final String COPY_SELECTION; static final String CUT_SELECTION; static final String PASTE_SELECTION; static final String VISIT_GRAPH; static final String VALIDATE; static final String UNDO; static final String SWITCH_GRID; static final String REDO; static final String SAVE; static final String EXPORT_PNG; static final String EXPORT_PDF; static final String EXPORT_JPG; static final String EXPORT_SVG; static final String EXPORT_BPMN; static final String DELETE_SELECTION; static final String CLEAR_DIAGRAM; static final String CLEAR_SHAPES; static final String CONFIRM_CLEAR_DIAGRAM; static final String PERFORM_AUTOMATIC_LAYOUT; static final String NEW_LINE; static final String DOT; static final String COLON; static final String OPEN_BRA; static final String CLOSE_BRA; static final String OPEN_COMMENT; static final String CLOSE_COMMENT; }### Answer:
@Test public void testBeanValidationMessage() { final ConstraintViolation<?> rootViolation = mock(ConstraintViolation.class); final Path propertyPath = mock(Path.class); when(propertyPath.toString()).thenReturn("path1"); when(rootViolation.getPropertyPath()).thenReturn(propertyPath); when(rootViolation.getMessage()).thenReturn("message1"); final ModelBeanViolation violation = ModelBeanViolationImpl.Builder.build(rootViolation, "uuid"); final String message = CoreTranslationMessages.getBeanValidationMessage(translationService, violation); assertEquals(VALIDATION_BEAN_MESSAGE, message); }