EvoMaster icon indicating copy to clipboard operation
EvoMaster copied to clipboard

Why is this test generated in EvoMaster_fault_representatives_Test.java

Open aruvic opened this issue 1 year ago • 2 comments

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);
    }

aruvic avatar May 22 '24 08:05 aruvic

Hi @aruvic ,

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

arcuri82 avatar May 22 '24 08:05 arcuri82

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

aruvic avatar May 22 '24 08:05 aruvic

@aruvic now we have descriptions for found faults on the generated tests. is this problem here still happening in latest release?

arcuri82 avatar Oct 28 '24 13:10 arcuri82

closed as no more info provided, and likely fixed in latest releases with new fault info comments in generated tests

arcuri82 avatar Jan 23 '25 20:01 arcuri82