# How not to use test:framework

**URL:** <https://discuss.elastic.co/t/how-not-to-use-test-framework/230171>\
**Category:** Elasticsearch\
**Created:** [April 28, 2020, 12:42pm UTC](https://discuss.elastic.co/t/how-not-to-use-test-framework/230171 "2020-04-28T12:42:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xjtushilei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xjtushilei/32/34572_2.png) [@xjtushilei](https://discuss.elastic.co/u/xjtushilei)\
**Post date:** [April 28, 2020, 12:42pm UTC](https://discuss.elastic.co/t/how-not-to-use-test-framework/230171/1 "2020-04-28T12:42:21Z")

</div>

I am writing a plug-in, and ported to the ES code repository. It is located in the plugins directory. In this way, I can easily quote ES code without referring to the jar package.

I wrote this plugin using junit4 and mockito2.x, now I want to run the tests in the plugin, there is no way to run it. es test: framework uses mockito1.x. If I modify my test code, the cost is very high. And after adapting my code to 1.x, this error cannot be fixed:

Caused by: java.lang.NullPointerException at org.mockito.internal.exceptions.stacktrace.StackTraceFilter.

For example, `A a = mock (A.class) `will trigger the above bug

1. Is there any way to solve this problem?
2. To change the way of thinking, is there a way to run my test alone without using test: framework instead of running the test with ES?

---

<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:** [May 26, 2020, 12:42pm UTC](https://discuss.elastic.co/t/how-not-to-use-test-framework/230171/2 "2020-05-26T12:42:30Z")

</div>

Closed on May 26, 2020, 12:42pm UTC

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