Android Espresso 包 `android.support.test.espresso.intent` 的依赖项是什么?

What's the dependency for Android Espresso package `android.support.test.espresso.intent`?

我遇到了一个有趣的包,其中特别包含用于测试 Intent 发送的 Intents class,以及 IntentMatchers class,作为 Intents [= 上列出的片段21=] 页面显示:

Intent resultData = new Intent();
String phoneNumber = "123-345-6789";
resultData.putExtra("phone", phoneNumber);
ActivityResult result = new ActivityResult(Activity.RESULT_OK, resultData);

// Set up result stubbing when an intent sent to "contacts" is seen.
intending(toPackage("com.android.contacts")).respondWith(result));

但是当我开始尝试时,Android Studio 抱怨不知道这些 classes。我检查了 android-test-kit website 上列出的 Espresso 罐子(espresso-core 和 espreso-contrib),实际上我在这些罐子里找不到任何 android.support.test.espresso.intent 包。我缺少任何依赖项吗?

你还需要

androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2'

有关详细信息,请参阅 https://code.google.com/p/android-test-kit/wiki/EspressoIntentsSetupInstructions