package org.hibernate.search.demos.wikipedia;

import static io.restassured.RestAssured.given;
import static org.skyscreamer.jsonassert.JSONCompare.compareJSON;

import org.junit.Test;
import org.junit.runner.RunWith;

import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import org.json.JSONException;
import org.skyscreamer.jsonassert.JSONCompareMode;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ActiveProfiles("test")
public class HsearchElasticsearchWikipediaApplicationIT {

	static {
		RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
	}

	@Test
	public void indexAndSearch() throws JSONException {
		String body = given().param( "q", "brave" )
				.when().get( "/page/search" )
				.then()
				.statusCode( 200 )
				.extract().body().asString();
		compareJSON( "{\"totalCount\": 0}", body, JSONCompareMode.LENIENT );

		given().body( "{\"title\": \"Brave new World\", \"content\": \"A classic.\"}" )
				.contentType( ContentType.JSON )
				.when().post( "/page" ).then()
				.statusCode( 201 );

		body = given().param( "q", "brave" )
				.when().get( "/page/search" )
				.then()
				.statusCode( 200 )
				.extract().body().asString();
		compareJSON( "{\"totalCount\": 1}", body, JSONCompareMode.LENIENT );
	}

}

@@ -176,45 +176,24 @@
 nit.
-Test;%0Aimport org.
 ju
-nit.runner.RunWith
+piter.api.Test
 ;%0A%0Ai
@@ -469,98 +469,8 @@
 es;%0A
-import org.springframework.test.context.junit4.SpringRunner;%0A%0A@RunWith(SpringRunner.class)
 %0A@Sp

Upgrade to JUnit 5