Example usage for android.test MoreAsserts assertEmpty

List of usage examples for android.test MoreAsserts assertEmpty

Introduction

In this page you can find the example usage for android.test MoreAsserts assertEmpty.

Prototype

public static void assertEmpty(Map<?, ?> map) 

Source Link

Document

Variant of #assertEmpty(String,Map) using a generic message.

Usage

From source file:com.google.android.apps.authenticator.timesync.NetworkTimeProviderTest.java

public void testRequest() throws Exception {
    withHttpRequestThrowing(new IOException("arbitrary"));
    try {//from   w  ww. ja  v  a2s  .com
        mProvider.getNetworkTime();
    } catch (Exception expected) {
    }

    ArgumentCaptor<HttpUriRequest> requestCaptor = ArgumentCaptor.forClass(HttpUriRequest.class);
    verify(mMockHttpClient).execute(requestCaptor.capture());

    HttpUriRequest request = requestCaptor.getValue();
    assertEquals("HEAD", request.getMethod());
    assertEquals("https://www.google.com", request.getURI().toString());
    MoreAsserts.assertEmpty(Arrays.asList(request.getAllHeaders()));
}