Modification modificationFromDescription(String output, ConsoleResult result) throws P4OutputParseException {
        String[] parts = StringUtils.splitByWholeSeparator(output, SEPARATOR);
        Pattern pattern = Pattern.compile(DESCRIBE_OUTPUT_PATTERN, Pattern.MULTILINE);
        Matcher matcher = pattern.matcher(parts[0]);
        if (matcher.find()) {
            Modification modification = new Modification();
            parseFistline(modification, matcher.group(1), result);
            parseComment(matcher, modification);
            parseAffectedFiles(parts, modification);
            return modification;
        }
        throw new P4OutputParseException("Could not parse P4 description: " + output);
    }
@Test
    void shouldRetrieveModificationFromDescription() throws P4OutputParseException, ParseException {
        String output =
                """
                        Change 2 by cce123user@connect4_10.18.2.31 on 2008/08/19 15:04:43

                        \tAdded config file

                        Affected files ...

                        ... //depot/cruise-config.xml#1 add
                        ... //depot/README.txt#2 edit
                        ... //depot/cruise-output/log.xml#1 delete
                        """;
        Modification mod = parser.modificationFromDescription(output, new ConsoleResult(0, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>()));
        assertThat(mod.getRevision()).isEqualTo("2");
        assertThat(mod.getUserName()).isEqualTo("cce123user@connect4_10.18.2.31");
        assertThat(mod.getModifiedTime()).isEqualTo(DESCRIPTION_FORMAT.parse("2008/08/19 15:04:43"));
        assertThat(mod.getComment()).isEqualTo("Added config file");
        List<ModifiedFile> files = mod.getModifiedFiles();
        assertThat(files.size()).isEqualTo(3);
        assertThat(files.get(0).getAction()).isEqualTo(ModifiedAction.added);
        assertThat(files.get(0).getFileName()).isEqualTo("cruise-config.xml");
        assertThat(files.get(1).getAction()).isEqualTo(ModifiedAction.modified);
        assertThat(files.get(2).getAction()).isEqualTo(ModifiedAction.deleted);
        assertThat(files.get(2).getFileName()).isEqualTo("cruise-output/log.xml");
    }