To create an integration test, you need to add the following annotation to your test class:
@MeilisearchTest
@ContextConfiguration(classes = {MeilisearchTestConfiguration.class})
class MeilisearchTest {
@Autowired
Client client;
@Test
void test() {
// ...
}
}
The MeilisearchTest
annotation means that the test is run in integration with Meilisearch.
This code makes it easy to run the container.
MeilisearchTestConfiguration
is a configuration class for providing a Client
associated with a container run by MeilisearchTest.