citrusframework / citrusframework/citrus

Citrus-Maven-Plugin: 'Generate Docs'-Mojo fails on plain Java Tests

Open
#450 2 comments 0 reactions 0 assignees View on GitHub
feature prio-medium
Dominant language
Java
Stars
485
Forks
155
Avg merge
4d 22h
Merged PRs (30d)
6

Description

Hi,

when running the 'citrus:create-docs' or 'citrus:generate-docs' Mojo on a Citrus project that contains plain Java-Tests (not the Java-Test-'Stubs' that refer to a XML-Test) the report does not contain those tests.

Citrus-Version: Tested on 2.7.6 and 2.8.0-SNAPSHOT

Expected Behavior: Report should contain the Java-based Tests and the XML-based Tests
Actual Behavior: Report only contains XML-based Tests

Further notes:
It seems as if the `protected List getTestFiles()` Method (located in [AbstractTestDocsGenerator.java](https://github.com/citrusframework/citrus/blob/master/tools/docs-generator/src/main/java/com/consol/citrus/docs/AbstractTestDocsGenerator.java)) only searches for XML-based tests.
```
protected List getTestFiles() throws IOException {
if (testFiles == null) {
testFiles = FileUtils.findFiles(srcDirectory + "resources" + File.separator, Citrus.getXmlTestFileNamePattern());
}

return testFiles;
}
```

Also the implementations of `public abstract void doBody(OutputStream buffered)` and `public abstract void doHeader(OutputStream buffered)` (located in [AbstractTestDocsGenerator.java](https://github.com/citrusframework/citrus/blob/master/tools/docs-generator/src/main/java/com/consol/citrus/docs/AbstractTestDocsGenerator.java)) seem to only work with XML-files.

Contributor guide

Open the contributing guide

Research direction

Start in tools/docs-generator/src/main/java/com/consol/citrus/docs/AbstractTestDocsGenerator.java, reading getTestFiles(), doBody(), and doHeader(). Reproduce the issue by running the citrus:create-docs or citrus:generate-docs Mojo on a project containing plain Java tests and XML tests. Done means the generated report contains both Java-based and XML-based tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.