Search in sources :

Example 1 with AssociationRequest

use of android.companion.AssociationRequest in project robolectric by robolectric.

the class ShadowCompanionDeviceManagerTest method testAssociate.

@Test
public void testAssociate() {
    AssociationRequest request = new AssociationRequest.Builder().build();
    CompanionDeviceManager.Callback callback = new CompanionDeviceManager.Callback() {

        @Override
        public void onDeviceFound(IntentSender chooserLauncher) {
        }

        @Override
        public void onFailure(CharSequence error) {
        }
    };
    companionDeviceManager.associate(request, callback, null);
    assertThat(shadowCompanionDeviceManager.getLastAssociationRequest()).isSameInstanceAs(request);
    assertThat(shadowCompanionDeviceManager.getLastAssociationCallback()).isSameInstanceAs(callback);
}
Also used : CompanionDeviceManager(android.companion.CompanionDeviceManager) AssociationRequest(android.companion.AssociationRequest) IntentSender(android.content.IntentSender) Test(org.junit.Test)

Aggregations

AssociationRequest (android.companion.AssociationRequest)1 CompanionDeviceManager (android.companion.CompanionDeviceManager)1 IntentSender (android.content.IntentSender)1 Test (org.junit.Test)1