### Question:
DecisionTableXLSServiceImpl extends KieService<DecisionTableXLSContent> implements DecisionTableXLSService,
                   ExtendedDecisionTableXLSService { @Override public Path save(final Path resource, final InputStream content, final String sessionId, final String comment) { return writeToFile(resource, content, sessionId, comment, false); } DecisionTableXLSServiceImpl(); @Inject  DecisionTableXLSServiceImpl(@Named("ioStrategy") final IOService ioService,
                                       final CopyService copyService,
                                       final DeleteService deleteService,
                                       final RenameService renameService,
                                       final Event<ResourceOpenedEvent> resourceOpenedEvent,
                                       final DecisionTableXLSConversionService conversionService,
                                       final GenericValidator genericValidator,
                                       final CommentedOptionFactory commentedOptionFactory,
                                       final AuthenticationService authenticationService); @Override DecisionTableXLSContent loadContent(final Path path); @Override InputStream load(final Path path,
                            final String sessionId); @Override Path create(final Path resource,
                       final InputStream content,
                       final String sessionId,
                       final String comment); @Override Path save(final Path resource,
                     final InputStream content,
                     final String sessionId,
                     final String comment); @Override String getSource(final Path path); @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 ConversionResult convert(final Path path); @Override List<ValidationMessage> validate(final Path path,
                                            final Path resource);  }### Answer:
@Test public void testSessionInfoOnSave() { when(ioService.newOutputStream(any(org.uberfire.java.nio.file.Path.class), commentedOptionArgumentCaptor.capture())).thenReturn(outputStream); this.service = getServiceWithValidationOverride((tempFile) -> { }); service.save(path, inputstream, sessionId, comment); final InOrder inOrder = inOrder(ioService); inOrder.verify(ioService).startBatch(any()); inOrder.verify(ioService).newOutputStream(any(), any()); inOrder.verify(ioService).endBatch(); assertCommentedOption(); }
@Test public void testInvalidTableNotSaved() throws IOException { when(ioService.newOutputStream(any(org.uberfire.java.nio.file.Path.class), commentedOptionArgumentCaptor.capture())).thenReturn(outputStream); testInvalidTable((s) -> s.save(path, inputstream, sessionId, comment)); }