Android Local Unit Tests
How to create ObjectBox local unit tests for Android projects.
Android Local Unit Tests
Set Up Your Testing Environment
dependencies {
// Required -- JUnit 4 framework
testImplementation("junit:junit:4.12")
// Optional -- manually add native ObjectBox library to override auto-detection
testImplementation("io.objectbox:objectbox-linux:$objectboxVersion")
testImplementation("io.objectbox:objectbox-macos:$objectboxVersion")
testImplementation("io.objectbox:objectbox-windows:$objectboxVersion")
// Not added automatically:
// Since 2.9.0 we also provide ARM support for the Linux library
testImplementation("io.objectbox:objectbox-linux-arm64:$objectboxVersion")
testImplementation("io.objectbox:objectbox-linux-armv7:$objectboxVersion")
}Create a Local Unit Test Class
Base class for tests
Testing Entities with Relations
Last updated
Was this helpful?