---
title: spring-boot-autoconfigure模块ElasticSearch测试问题的解决方法
description: "ElasticSearch测试中使用了注解@Testcontainers(disabledWithoutDocker = true)来检测环境是否支持Docker。如果支持Docker，则执行该用例；如果不支持，则跳过该用例。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengwebs/ecosystemEnable/SpringBoot/kunpengspringboot_02_0018.html
sourcePath: /source/zh/kunpengwebs/ecosystemEnable/SpringBoot/kunpengspringboot_02_0018.html
indexId: 54e56807bb35e46db1d0b892fc3b955370b81b63ef9b25f0e507a603499acb2680
---
# spring-boot-autoconfigure模块ElasticSearch测试问题的解决方法

#### 问题现象描述

ElasticSearch测试中使用了注解@Testcontainers(disabledWithoutDocker = true)来检测环境是否支持Docker。如果支持Docker，则执行该用例；如果不支持，则跳过该用例。


#### 关键过程、根本原因分析

如果编译环境已经安装了Docker，并且已经启动成功，可以在编译前关闭Docker。


#### 结论、解决方案及效果

1. 执行如下命令关闭Docker服务。

```
systemctl stop docker
```


2. 关闭Docker服务后，再次进行ElasticSearch测试。
