Skip to content

Instantly share code, notes, and snippets.

@marukami
Last active September 11, 2018 22:40
Show Gist options
  • Save marukami/d1d01d55a614ace4f94ccdaf806059ac to your computer and use it in GitHub Desktop.
Save marukami/d1d01d55a614ace4f94ccdaf806059ac to your computer and use it in GitHub Desktop.
kotlin-allopen annotation
/**
* This annotation allows us to open some classes for mocking purposes while they are final in
* release builds.
*/
@Target(AnnotationTarget.ANNOTATION_CLASS)
annotation class OpenClass
/**
* Annotate a class with [OpenForTesting] if you want it to be extendable in debug builds.
*/
@OpenClass
@Target(AnnotationTarget.CLASS)
annotation class OpenForTesting
// Forked from https://github.com/googlesamples/android-architecture-components/blob/d81da2cb1e3d61e40f052e631bb15883d0f9f637/GithubBrowserSample/app/src/debug/java/com/android/example/github/testing/OpenForTesting.kt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment