It's not clear how you're building the embedded node, but if you use ESSingleNodeTestCase or ESIntegTestCase these do no include modules (which the PainlessPlugin is distributed as) by default. Additionally, if you construct a Node by hand, that too does not include the PainlessPlugin. Instead, you have to include it as a plugin for your node (which you can do by overriding certain methods on the test cases I mentioned, or when you construct the node). However, we do not support this, we do not do this anywhere in our testing infrastructure. Instead, when we want to test Painless, we build the zip distribution (which includes all modules by default) and start a standalone node which we then connect to with either the transport client or the REST clients. You can see examples of these in our standalone tests. I hope this helps clarify the situation.