citrusframework / citrusframework/citrus

JavaTestGenerator produces XML-Test Java files

Open
#589 1 comment 0 reactions 0 assignees View on GitHub
bug prio-medium
Dominant language
Java
Stars
485
Forks
155
Avg merge
4d 22h
Merged PRs (30d)
6

Description

**Citrus Version**
2.7.8

**Expected behavior**
The `JavaTestGenerator` generates Java Citrus tests.

**Actual behavior**
The `JavaTestGenerator` generates XML Citrus tests.

**Test case sample**
```java
new JavaTestGenerator()
.withAuthor("Sven")
.withDescription("This is a sample java test")
.withName("SampleIT")
.usePackage("com.consol.citrus.sample")
.withFramework(UnitFramework.TESTNG)
.create();
```

generates

```java
/**
* This is a sample java test
*
* @author Sven
* @since 2019-01-14
*/
public class SampleIT extends AbstractTestNGCitrusTest {
@CitrusXmlTest(
name = "SampleIT"
)
@Test
public void sampleIT(@CitrusResource TestRunner testRunner) {
}
}
```

**Additional information**
This issue is important for #450 to reduce testing efforts.

Contributor guide

Open the contributing guide

Research direction

Start by locating the JavaTestGenerator implementation and the tests covering its create() output. Reproduce the provided TestNG example and compare the generated source with the expected Java Citrus test behavior. Done means JavaTestGenerator emits the intended Java test content rather than an XML-test wrapper, with a regression test covering the sample.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.