Unit test using Springboot to check if an index exists in Elasticsearch

How do I write a unit test case using Springboot to check if an index exists in Elasticsearch version 8.7?

This could not be a unit test then. But an integration test.

Yes, I need to write an integration test for springboot+elasticsearch.

May be this could give you some ideas?