Added integration test and reverted a commit.

Reverted commit SHA 8e2df9abea56a39fcd00f3e6fd72312bc31df7d1 as it breaks the plugin (and added an integration test to show that)