GuidedRuleEditorServiceImpl extends KieService<GuidedEditorContent> implements GuidedRuleEditorService { @Override public List<ValidationMessage> validate(final Path path, final RuleModel content) { try { final String source = toSourceUnexpanded(path, content); return genericValidator.validate(path, source); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } } GuidedRuleEditorServiceImpl(); @Inject  GuidedRuleEditorServiceImpl(final SessionInfo sessionInfo,
                                       final Instance<RuleModelIActionPersistenceExtension> persistenceExtensionInstance); @PostConstruct void init(); @Override Path create(final Path context,
                       final String fileName,
                       final RuleModel model,
                       final String comment); @Override RuleModel load(final Path path); @Override GuidedEditorContent loadContent(final Path path); @Override Path save(final Path resource,
                     final RuleModel model,
                     final Metadata metadata,
                     final String comment); @Override void delete(final Path path,
                       final String comment); @Override Path rename(final Path path,
                       final String newName,
                       final String comment); @Override Path copy(final Path path,
                     final String newName,
                     final String comment); @Override Path copy(final Path path,
                     final String newName,
                     final Path targetDirectory,
                     final String comment); @Override String toSource(final Path path,
                           final RuleModel model); @Override List<ValidationMessage> validate(final Path path,
                                            final RuleModel content); @Override Path saveAndRename(final Path path,
                              final String newFileName,
                              final Metadata metadata,
                              final RuleModel content,
                              final String comment);  }
@Test public void testValidateModifyScoreAction() throws Exception { final Path path = mock(Path.class); final FreeFormLine modifyAction = new FreeFormLine(); modifyAction.setText(MODIFY_SCORE_ACTION); final RuleModel model = new RuleModel(); model.addRhsItem(modifyAction); service.validate(path, model); final ArgumentCaptor<String> capturedFileContent = ArgumentCaptor.forClass(String.class); verify(genericValidator).validate(eq(path), capturedFileContent.capture()); Assertions.assertThat(capturedFileContent.getValue()).contains(MODIFY_SCORE_ACTION); }