Skip to content

@QueryMap contains jacocoData artifacts when testing code coverage #839

@shaburov

Description

@shaburov

Interfase

    @RequestLine(value = "GET /api/v2/get_cases/{project_id}")
    List<Case> getCases(@Param("project_id") Integer pID, @QueryMap GetCasesQueryMap queryMap);

Example test

void unitTest_20181112134620() {
            GetCasesQueryMap map = new GetCasesQueryMap();
            map.setTypeId(3);
            CLIENT.getCases(34530, map);
            assertThat(TEST_LOGGER.takeLoggedMessages().toString())
                    .contains(GET_API + "/get_cases/34530&type_id=3 HTTP/1.1");
        }

Run test with jacoco from IDE or console

image

Expected

GET http://localhost:19876/api/v2/get_cases/34530?type_id=3 HTTP/1.1

Actual contains lambda jacocoData

[TestRailClient#getCases] ---> GET http://localhost:19876/api/v2/get_cases/34530?type_id=3&%24jacocoData=%5BZ%4054c5a2ff HTTP/1.1

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions