# How do add Junt Test in ES6 plugin

**URL:** <https://discuss.elastic.co/t/how-do-add-junt-test-in-es6-plugin/113166>\
**Category:** Elasticsearch\
**Created:** [December 26, 2017, 3:17am UTC](https://discuss.elastic.co/t/how-do-add-junt-test-in-es6-plugin/113166 "2017-12-26T03:17:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arliang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arliang/32/25967_2.png) [@arliang](https://discuss.elastic.co/u/arliang)\
**Post date:** [December 26, 2017, 3:17am UTC](https://discuss.elastic.co/t/how-do-add-junt-test-in-es6-plugin/113166/1 "2017-12-26T03:17:25Z")

</div>

Dear All  
I want to add a Junit Test for the [elasticsearch-analysis-ik](https://github.com/medcl/elasticsearch-analysis-ik)  
project, read the [official documents](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/using-elasticsearch-test-classes.html) there are haves many questions.

Can give me more detailed instructions or examples for ElasticSearch6 and Maven.  
Currently found information is the old version（ES2 ES5) at Google.

Thank you  
Wish you happy every day in the new year .

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 3, 2018, 10:13am UTC](https://discuss.elastic.co/t/how-do-add-junt-test-in-es6-plugin/113166/2 "2018-01-03T10:13:57Z")

</div>

Can you please be more exact what your problem is?

You can import the dependency and then extend your tests from `ESTestCase`. There are more things to do like ensuring the security manager is always active (which I dont know how that works with mvn) - but you could go from there.

--Alex

---

<div class="post-metadata">

**Author:** ![arliang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arliang/32/25967_2.png) [@arliang](https://discuss.elastic.co/u/arliang)\
**Post date:** [January 4, 2018, 2:32am UTC](https://discuss.elastic.co/t/how-do-add-junt-test-in-es6-plugin/113166/3 "2018-01-04T02:32:14Z")

</div>

Dear Alex  
Thank you give me a keyword `ESTestCase` . I find some rare description in official website，but I will not use gradle .  
please give me a sample code "How do use ESTestCase in maven and es6.1".  
Currently only found document about ESTestCase , all for ES 5.X , I not sure he is working properly.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 4, 2018, 9:15am UTC](https://discuss.elastic.co/t/how-do-add-junt-test-in-es6-plugin/113166/4 "2018-01-04T09:15:48Z")

</div>

I use gradle, so I do not have an example ready.

Please state what your actual problem is, so others can take a look as well.

--Alex

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 1, 2018, 9:16am UTC](https://discuss.elastic.co/t/how-do-add-junt-test-in-es6-plugin/113166/5 "2018-02-01T09:16:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
