Rest-assured: Does server need to be running?

Created on 15 Nov 2016  路  1Comment  路  Source: rest-assured/rest-assured

I've been using rest-assured under the impression that the server needs to be running in order to run my rest assured tests. Is this true?

Here's what one of my tests looks like:

@Test
public void shouldReturn401() {
    when()
        .get("http://localhost:8080/myapp/api/v1/documents")
    .then()
        .statusCode(401);
}

It works great when my server is running, but your documentation doesn't mention that the server has to be running.

Is rest-assured intended to be used without a server running? In my case my app is running in a Tomcat container.

Most helpful comment

Hi,

Yes, the server needs to be running. REST Assured is essentially an HTTP Client that communicates (tests) the API of a server.

Regards,
/Johan

>All comments

Hi,

Yes, the server needs to be running. REST Assured is essentially an HTTP Client that communicates (tests) the API of a server.

Regards,
/Johan

Was this page helpful?
0 / 5 - 0 ratings