Skip to content

Instantly share code, notes, and snippets.

@orhanobut
Last active July 3, 2016 18:18
Show Gist options
  • Save orhanobut/a679ae6e6262ca43f065 to your computer and use it in GitHub Desktop.
Save orhanobut/a679ae6e6262ca43f065 to your computer and use it in GitHub Desktop.
@RunWith(AndroidJUnit4.class)
public class GooglePlacesApiTest {
GoogleApiClient apiClient;
@Before public void setup() throws InterruptedException {
Context context = InstrumentationRegistery.getContext();
apiClient = new GoogleApiClient.Builder(context)
.addApi(Places.GEO_DATA_API)
.addApi(Places.PLACE_DETECTION_API)
.build();
apiClient.connect();
}
@Test public void apiClientShouldConnectSuccessfully() {
assertThat(apiClient.isConnected()).isTrue();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment