Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is this test generated in EvoMaster_fault_representatives_Test.java #985

Open
aruvic opened this issue May 22, 2024 · 2 comments
Open
Labels

Comments

@aruvic
Copy link

aruvic commented May 22, 2024

Hi,

Please, can you explain me why following test is generated by EvoMaster in file: EvoMaster_fault_representatives_Test.java

    @Test @Timeout(60)
    public void test_1() throws Exception {
        List<InsertionDto> insertions = sql().insertInto("MY_ENTITY", 3525L)
                .d("CREATION_DATE", "NULL")
                .d("DESCRIPTION", "NULL")
                .d("NAME", "\"gOFnxwrzB20w\"")
                .d("ROLE", "\"eNmP1rmXiaup\"")
                .d("STATUS", "\"\"")
            .dtos();
        InsertionResultsDto insertionsresult = controller.execInsertionsIntoDatabase(insertions);
        ExpectationHandler expectationHandler = expectationHandler();
        
        ValidatableResponse res_0 = given().accept("*/*")
                .header("x-EMextraHeader123", "_EM_982_XYZ_")
                .contentType("application/json")
                .body(" { " + 
                    " \"id\": 1, " + 
                    " \"description\": \"FsXh2mxjt\", " + 
                    " \"status\": \"UayT47OFx0Xfx\", " + 
                    " \"relatedParty\": {} " + 
                    " } ")
                .put(baseUrlOfSut + "/api/myentity/1?" + 
                    "EMextraParam123=_EM_981_XYZ_&" + 
                    "fields=sHL4")
                .then()
                .statusCode(200)
                .assertThat()
                .contentType("application/json")
                .body("'name'", nullValue())
                .body("'description'", containsString("FsXh2mxjt"))
                .body("'status'", containsString("UayT47OFx0Xfx"))
                .body("'creationDate'", nullValue())
                .body("'relatedParty'.'role'", nullValue());
        
        expectationHandler.expect(ems);
    }
@arcuri82 arcuri82 added the bug label May 22, 2024
@arcuri82
Copy link
Collaborator

Hi @aruvic ,

thanks for reporting this bug. Indeed there would be no reason for why such a test should endup in fault_representatives group

@aruvic
Copy link
Author

aruvic commented May 22, 2024

Indeed there would be no reason for why such a test should endup in fault_representatives group

That's what I thought as well. PUT is expected to perform full resource updates and PATCH for partial updates. In above example name is expected to be NULL after PUT where no name was provided.

Br,
Alen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants