Skip to content

Commit

Permalink
Changed Generated Test Case Class Names
Browse files Browse the repository at this point in the history
  • Loading branch information
onurd86 committed Sep 26, 2023
1 parent 6b9f4e7 commit e2dffba
Showing 1 changed file with 12 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ public class EndpointFocusAndPrefixTest extends SpringTestBase {
/*
*/
public static void initClass() throws Exception {

SpringTestBase.initClass(new EndpointFocusAndPrefixController());

}

@Test
Expand All @@ -41,7 +39,7 @@ public void testRunBlackboxWithoutFocusOrPrefix() {
List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.WithoutFocusOrPrefix"),
ClassName.get("org.foo.BlackboxWithoutFocusOrPrefix"),
true);
// program arguments for EvoMaster
args.add("--blackBox");
Expand Down Expand Up @@ -73,7 +71,7 @@ public void testAllPathsInTestWhenFocusOrPrefixNotProvided() {
List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.WithoutFocusOrPrefixAllPaths"),
ClassName.get("org.foo.AllPathsInTestWhenFocusOrPrefixNotProvided"),
true);
// program arguments for EvoMaster
args.add("--blackBox");
Expand Down Expand Up @@ -130,13 +128,12 @@ else if (currentPathItem.getDelete() != null) {
public void testRunBlackboxWithFocusWithoutParameters() {

String outputFolder = "EndPointFocusAndPrefix";

String endpointFocus = "/api/pet";

List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.WithNonParametrizedFocus"),
ClassName.get("org.foo.BlackboxWithFocusWithoutParameters"),
true);
// program arguments for EvoMaster
args.add("--blackBox");
Expand All @@ -148,7 +145,6 @@ public void testRunBlackboxWithFocusWithoutParameters() {
args.add("--endpointFocus");
args.add(endpointFocus);


// no endpointFocus or endpointPrefix is provided
Solution<RestIndividual> solution = initAndRun(args);

Expand All @@ -169,13 +165,12 @@ public void testRunBlackboxWithFocusWithoutParameters() {
public void testRunBlackboxWithFocusWithParameters() {

String outputFolder = "EndPointFocusAndPrefix";

String endpointFocus = "/api/pet/{petId}";

List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.WithParametrizedFocus"),
ClassName.get("org.foo.BlackboxWithFocusWithParameters"),
true);

// program arguments for EvoMaster
Expand Down Expand Up @@ -207,13 +202,12 @@ public void testRunBlackboxWithFocusWithParameters() {
public void testRunBlackboxWithFocusOneEndpoint() {

String outputFolder = "EndPointFocusAndPrefix";

String endpointFocus = "/api/store/inventory";

List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.InvalidFocusValidPrefix"),
ClassName.get("org.foo.BlackboxWithFocusOneEndpoint"),
true);

// program arguments for EvoMaster
Expand Down Expand Up @@ -245,13 +239,12 @@ public void testRunBlackboxWithFocusOneEndpoint() {
public void testRunBlackboxWithPrefixWithoutParameters() {

String outputFolder = "EndPointFocusAndPrefix";

String endpointPrefix = "/api/user";

List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.WithNonParametrizedPrefix"),
ClassName.get("org.foo.BlackboxWithPrefixWithoutParameters"),
true);
// program arguments for EvoMaster
args.add("--blackBox");
Expand Down Expand Up @@ -282,13 +275,12 @@ public void testRunBlackboxWithPrefixWithoutParameters() {
public void testRunBlackboxWithPrefixWithParameters() {

String outputFolder = "EndPointFocusAndPrefix";

String endpointPrefix = "/api/pet/{petId}";

List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.WithParametrizedPrefix"),
ClassName.get("org.foo.BlackboxWithPrefixWithParameters"),
true);
// program arguments for EvoMaster
args.add("--blackBox");
Expand Down Expand Up @@ -325,7 +317,7 @@ public void testRunBlackboxFocusNonExistingFocusValidPrefix() {
List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.WithParametrizedPrefix"),
ClassName.get("org.foo.BlackboxFocusNonExistingFocusValidPrefix"),
true);
// program arguments for EvoMaster
args.add("--blackBox");
Expand Down Expand Up @@ -356,7 +348,7 @@ public void testRunBlackboxPrefixNonExistingFocusValidPrefix() {
List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.WithParametrizedPrefix"),
ClassName.get("org.foo.BlackboxPrefixNonExistingFocusValidPrefix"),
true);
// program arguments for EvoMaster
args.add("--blackBox");
Expand Down Expand Up @@ -388,13 +380,12 @@ public void testRunBlackboxPrefixNonExistingFocusValidPrefix() {
public void testRunBlackboxNonExistingFocusNonExistingPrefix() {

String outputFolder = "EndPointFocusAndPrefix";

String endpointPrefix = "/api/ab/s1";

List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.WithParametrizedPrefix"),
ClassName.get("org.foo.BlackboxNonExistingFocusNonExistingPrefix"),
true);
// program arguments for EvoMaster
args.add("--blackBox");
Expand All @@ -408,21 +399,18 @@ public void testRunBlackboxNonExistingFocusNonExistingPrefix() {

// check for IllegalArgumentException
assertThrows(IllegalArgumentException.class, () -> initAndRun(args));

}


@Test
public void testRunBlackboxPrefixNonExistingPrefix() {

String outputFolder = "EndPointFocusAndPrefix";

String endpointPrefix = "/api/store/inventory/in";

List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.WithParametrizedPrefix"),
ClassName.get("org.foo.BlackboxPrefixNonExistingPrefix"),
true);
// program arguments for EvoMaster
args.add("--blackBox");
Expand All @@ -443,13 +431,12 @@ public void testRunBlackboxPrefixNonExistingPrefix() {
public void testRunBlackboxBothFocusAndPrefix() {

String outputFolder = "EndPointFocusAndPrefix";

String endpoint = "/api/store/order";

List<String> args = getArgsWithCompilation(
40,
outputFolder,
ClassName.get("org.foo.WithParametrizedPrefix"),
ClassName.get("org.foo.BlackboxBothFocusAndPrefix"),
true);

// program arguments for EvoMaster
Expand Down

0 comments on commit e2dffba

Please sign in to comment.