Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


package com.google.maps.android.testing.golden

import com.google.common.truth.Truth.assertThat
import org.junit.Test

/**
* `:golden-testing` consumes `:robolectric-testing` the same way an app does, so its test classpath
* shows what the published AAR puts on a consumer's classpath. A `robolectric.properties` there
* would register the Maps shadows for every Robolectric test in the consumer and clash with the
* consumer's own configuration.
*/
public class RobolectricConfigLeakTest {

@Test
public fun robolectricTestingDoesNotShipRootRobolectricProperties() {
val loader = checkNotNull(javaClass.classLoader)

assertThat(loader.getResources("robolectric.properties").toList()).isEmpty()
}

@Test
public fun robolectricTestingDoesNotShipPackageRobolectricProperties() {
val loader = checkNotNull(javaClass.classLoader)

assertThat(
loader.getResources("com/google/maps/android/robolectric/shadows/robolectric.properties").toList(),
).isEmpty()
}
}
2 changes: 1 addition & 1 deletion robolectric-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ High-fidelity Robolectric shadows and testing utilities for the Google Maps SDK
- **Google Truth Domain Subjects**: Fluent subjects (`GoogleMapSubject`, `MarkerSubject`, `CameraPositionSubject`, `LatLngSubject`, `LatLngBoundsSubject`, `CircleSubject`, `PolygonSubject`, `PolylineSubject`) via unified `assertThat(...)`.
- **Kotlin Power-Assert Support**: First-class boolean predicates, `Comparable` geodesic `Distance` (`distanceTo`, `<= 5.meters`), `in` bounds/circle operators, and `assertMap(...)` / `assertGeo(...)` entrypoints that render rich expression diagrams on failure.
- **1-Liner Lazy Test Harness & KTX**: `createTestMap()`, `withTestMap { ... }`, `map.markers`, `map.clickMarker("Title")`, and `map.pixelColorAt(latLng)` eliminate setup and shadow extraction ceremony.
- **Zero Boilerplate**: Drop-in configuration with `@EnableMapsShadows` or automatic classpath discovery via `robolectric.properties`.
- **Zero Boilerplate**: Drop-in configuration with `@EnableMapsShadows`. The library does not ship a `robolectric.properties`, so the shadows only apply to the tests you annotate.
- **Full Lifecycle & Async Dispatch**: Seamless simulation of `onCreate()`, `onStart()`, `onResume()`, `onDestroy()`, and async `getMapAsync()` callbacks.

---
Expand Down

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions robolectric-testing/src/main/resources/robolectric.properties

This file was deleted.

Loading