dimanche 22 mai 2016

Spring Boot - Rest Assured methods not found

I have a REST API built with Spring Boot.

I am attempting to use Rest-Assured test framework, however I can't seem to get it to work.

I am using the guide from Here

get("/lotto").then().assertThat().body("lotto.lottoId", equalTo(5));

And have added the dependencies to my maven project.

<dependency>
      <groupId>com.jayway.restassured</groupId>
      <artifactId>rest-assured</artifactId>
      <version>2.9.0</version>
      <scope>test</scope>
</dependency>

However, It doesn't seem to import the required classes and just prompts me to create a new "get()" method.

My Test class:

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(Application.class)
@WebIntegrationTest
public class DemoControllerTest  {

    @Test
    public void test() {
        get("/lotto").then().assertThat().body("lotto.lottoId", equalTo(5));
    }

}

What am I missing?

Aucun commentaire:

Enregistrer un commentaire