Skip to content

Commit

Permalink
fixed E2E
Browse files Browse the repository at this point in the history
  • Loading branch information
arcuri82 committed Oct 25, 2024
1 parent d41efd0 commit c770f52
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public void testRunBlackboxWithFocusWithParameters() throws Throwable {
args.add(baseUrlOfSut + "/v2/api-docs");
args.add("--endpointFocus");
args.add(endpointFocus);
setOption(args, "advancedBlackBoxCoverage", "false");

// no endpointFocus or endpointPrefix is provided
Solution<RestIndividual> solution = initAndRun(args);
Expand All @@ -174,7 +175,7 @@ public void testRunBlackboxWithFocusWithParameters() throws Throwable {
assertAllSolutionsHavePathFocusOrPrefixList(solution, pathsToCheck, true);

// The solution should include 4 solutions, 3 endpoints and 1 failure case
assertEquals(solution.getIndividuals().size(), 4);
assertEquals(4, solution.getIndividuals().size());

// write test into the output folder
compile(outputFolder);
Expand Down Expand Up @@ -283,6 +284,7 @@ public void testRunBlackboxWithPrefixWithParameters() throws Throwable {
args.add(baseUrlOfSut + "/v2/api-docs");
args.add("--endpointPrefix");
args.add(endpointPrefix);
setOption(args, "advancedBlackBoxCoverage", "false");

// no endpointFocus or endpointPrefix is provided
Solution<RestIndividual> solution = initAndRun(args);
Expand All @@ -294,7 +296,7 @@ public void testRunBlackboxWithPrefixWithParameters() throws Throwable {
assertAllSolutionsHavePathFocusOrPrefixList(solution, pathsToCheck, false);

// The solution should include 5 solutions, 4 endpoints and 1 failure case
assertEquals(solution.getIndividuals().size(), 5);
assertEquals(5, solution.getIndividuals().size());

// write test into the output folder
compile(outputFolder);
Expand Down Expand Up @@ -323,6 +325,7 @@ public void testRunBlackboxPrefixNonExistingFocusValidPrefix() throws Throwable
args.add(baseUrlOfSut + "/v2/api-docs");
args.add("--endpointPrefix");
args.add(endpointPrefix);
setOption(args, "advancedBlackBoxCoverage", "false");

// no endpointFocus or endpointPrefix is provided
Solution<RestIndividual> solution = initAndRun(args);
Expand All @@ -334,7 +337,7 @@ public void testRunBlackboxPrefixNonExistingFocusValidPrefix() throws Throwable
assertAllSolutionsHavePathFocusOrPrefixList(solution, pathsToCheck, false);

// The solution should include 5 solutions, 4 endpoints and 1 failure case
assertEquals(solution.getIndividuals().size(), 5);
assertEquals(5, solution.getIndividuals().size());

// write test into the output folder
compile(outputFolder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public void testRunAdaptiveHypermutation() throws Throwable {
//minimization loses impact info
args.add("--minimize");
args.add("false");

//this had side-effects
setOption(args, "advancedBlackBoxCoverage", "false");

Solution<RestIndividual> solution = initAndRun(args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class BodyUndefinedEMTest : SpringTestBase() {
20
) { args: MutableList<String> ->

//TODO remove once fixed issue
setOption(args, "advancedBlackBoxCoverage", "false")

val solution = initAndRun(args)

Assertions.assertTrue(solution.individuals.size >= 1)
Expand All @@ -35,7 +38,13 @@ class BodyUndefinedEMTest : SpringTestBase() {
There is some weird bug in Jersey that it looks like it transform the GET into a POST ?!?
When we upgrade Jersey (once moving ot JDK 11), need to fix AbstractRestFitness and RestActionBuilderV3.
Then, we will need to check if this fails, and if so, change
into a 400 and 200 instead of 415
into a 400 and 200 instead of 415.
Even more weird, need to deactivate advancedBB coverage, otherwise generated tests
add a .body(" {} ") to the GET.
in Jersey, this still give a 415, but then a different code in RestAssured when compiled
tests are executed... WTF!!!
TODO look into this once upgraded Jersey
*/
assertHasAtLeastOne(solution, HttpVerb.GET, 415, "/api/bodyundefined", null)
}
Expand Down

0 comments on commit c770f52

Please sign in to comment.