{"id":18329620,"url":"https://github.com/jupiter-tools/spring-test-elasticsearch","last_synced_at":"2025-06-26T05:02:21.549Z","repository":{"id":57725720,"uuid":"223958004","full_name":"jupiter-tools/spring-test-elasticsearch","owner":"jupiter-tools","description":"Tools to start Elasticsearch in docker containers  for tests with Spring","archived":false,"fork":false,"pushed_at":"2020-06-12T01:15:05.000Z","size":22,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-09T17:51:33.182Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jupiter-tools.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-25T13:42:00.000Z","updated_at":"2020-06-12T01:05:50.000Z","dependencies_parsed_at":"2022-09-02T03:31:12.819Z","dependency_job_id":null,"html_url":"https://github.com/jupiter-tools/spring-test-elasticsearch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jupiter-tools/spring-test-elasticsearch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupiter-tools%2Fspring-test-elasticsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupiter-tools%2Fspring-test-elasticsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupiter-tools%2Fspring-test-elasticsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupiter-tools%2Fspring-test-elasticsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jupiter-tools","download_url":"https://codeload.github.com/jupiter-tools/spring-test-elasticsearch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupiter-tools%2Fspring-test-elasticsearch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262003915,"owners_count":23243346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T19:18:04.760Z","updated_at":"2025-06-26T05:02:21.451Z","avatar_url":"https://github.com/jupiter-tools.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Test Elasticsearch\n\nimage:https://codecov.io/gh/jupiter-tools/spring-test-elasticsearch/branch/master/graph/badge.svg[\"\", link=\"https://codecov.io/gh/jupiter-tools/spring-test-elasticsearch\"]\n\n\nTools to write integration tests of Spring Framework with the Elasticsearch.\n\n## How to write integration tests on Spring Boot with Elasticsearch in docker\n\nAdd this library in dependencies:\n\n[source,xml]\n----\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.jupiter-tools\u003c/groupId\u003e\n    \u003cartifactId\u003espring-test-elasticsearch\u003c/artifactId\u003e\n    \u003cversion\u003e0.1\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\nNow, you can start the Elasticsearch cluster in a docker container(TestContainers) by the using of `@ElasticsearchTestContainer` annotation in tests:\n\n[source,java]\n----\n@ElasticsearchTestContainer\n@SpringBootTest\nclass SpTestElasticTestAppApplicationTests {\n\n    @Autowired\n    private ElasticsearchTemplate elasticsearchTemplate;\n\n    @BeforeAll\n    static void setUp() {\n        // populate a data set in index\n    }\n\n    @Test\n    void findTest() {\n       var query = GetQuery.getById(\"100123\");\n       Foo foo = elasticsearchTemplate.queryForObject(query, Foo.class);\n       assertThat(foo).isNotNull();\n    }\n}\n----","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjupiter-tools%2Fspring-test-elasticsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjupiter-tools%2Fspring-test-elasticsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjupiter-tools%2Fspring-test-elasticsearch/lists"}