diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php
index ae10e2730759e20885a6c67e04654ffdaa5a3f67..590e044b728c0d946d3cc93f3d9f717fd59e0cb6 100644
--- a/apps/files_trashbin/tests/TrashbinTest.php
+++ b/apps/files_trashbin/tests/TrashbinTest.php
@@ -67,7 +67,7 @@ class TrashbinTest extends \Test\TestCase {
 		// clear share hooks
 		\OC_Hook::clear('OCP\\Share');
 		\OC::registerShareHooks();
-		$application = new \OCA\Files_Sharing\AppInfo\Application();
+		$application = \OC::$server->query(\OCA\Files_Sharing\AppInfo\Application::class);
 		$application->registerMountProviders();
 
 		//disable encryption