Data4Life Test-Util SDK
Test-Util provide some convenience and necessary helpers in order to enable cross-platform testing.
Table Of Contents
About The Project
Test-Util provide some convenience and necessary helpers in order to enable cross-platform testing. Currently we support Android, JVM and iOS and Kotlin-Multiplatform.
Features
util-test
-
ResourceLoader for common code
-
Robolectric Annotation for common code
util-coroutine-test
-
runBlockingTest and runWithContextBlocking to enable tests with coroutines in common code
util-ktor-test
-
convenient Factory for MockClient
-
convenient Factory to produce a HelloWorld response
-
Plugin to to resolve directly objects in order to avoid integration tests with a MockClient
Built With
Getting Started
Requirements
-
Java 11 | Limitations of Java language features and APIs | Desugaring
-
Android 6.0 (API 23) to Android 11.0 (API 31)
Installation
Add the following maven repository url to your root build.gradle:
allprojects { repositories { ... maven { url = URI("https://maven.pkg.github.com/d4l-data4life/hc-test-util-sdk-kmp") credentials { username = project.findProperty("gpr.user") as String? ?: System.getenv("PACKAGE_REGISTRY_USERNAME") password = project.findProperty("gpr.key") as String? ?: System.getenv("PACKAGE_REGISTRY_TOKEN") } } } }
Your GitHub username and token needs to be stored in your global Gradle properties: ~/.gradle/gradle.properties
- NOTICE
-
You need to have read access to this repository and generate a personal access token with
repo
,write:packages
andread:packages
scope.
gpr.user=github-username gpr.key=github-token
test-util
dependencies { implementation "care.data4life.hc-test-util-sdk-kmp:test-util:$version" }
test-util-coroutine
Add following dependencies to your app build.gradle.
dependencies { implementation "care.data4life.hc-test-util-sdk-kmp:test-util-coroutine:$version" }
test-util-ktor
Add following dependencies to your app build.gradle.
dependencies { implementation "care.data4life.hc-test-util-sdk-kmp:test-util-ktor:$version" }
Roadmap
This project is work in progress. We are working on adding more functionality, guidelines, documentation and other improvements.
Changelog
See changelog
Versioning
We use Semantic Versioning as a guideline for our versioning.
Releases use this format: {major}.{minor}.{patch}
-
Breaking changes bump
{major}
and reset{minor}
&{patch}
-
Backward compatible changes bump
{minor}
and reset{patch}
-
Bug fixes bump
{patch}
Contributing
You want to help or share a proposal? You have a specific problem? Read the following:
-
Code of conduct for details on our code of conduct.
-
Contributing for details about how to report bugs and propose features.
-
Developing for details about our development process and how to build and test the project.
Copyright and License
Copyright (c) 2021 D4L data4life gGmbH / All rights reserved. Please refer to our License for further details.