dhis2 / performance-tests-locust

DHIS2 performance tests using locust.io
3 stars 2 forks source link

add: utility methods for error handling, post, get #21

Closed luciano-fiandesio closed 4 years ago

luciano-fiandesio commented 5 years ago

Introduced utility methods in superclass to remove some boilerplate code for:

POST

TrackedEntityInstances trackedEntityInstances = new TrackedEntityInstanceRandomizer().create( this.cache, 5 );

executeQuery( () -> post( "/api/trackedEntityInstances", trackedEntityInstances ) );

GET

QueryParams qp = QueryParams.create()
            .add("dimension", "pe:LAST_12_MONTHS")
            .add("displayProperty", "NAME")
            .add("dimension", "dx:cYeuwXTCPkU")
            .add("skipMeta", "true")
            .add("includeNumDen", "true")
            .add("filter", "ou:ImspTQPwCqd");
        executeQuery( () -> get("/api/29/analytics", qp ));
vilkg commented 5 years ago

I created a shared repo we can use for performance and API tests. When it's reviewed, I can publish it to github packages and this PR could use it. All there methods are implemented in that library. https://github.com/dhis2/api-test-utils