From 122751896bc21a42117e2f098d6de725d4c5e509 Mon Sep 17 00:00:00 2001 From: David Liu Date: Mon, 1 Jul 2019 16:20:16 -0700 Subject: [PATCH 1/2] Update README.md --- governator-test-junit/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/governator-test-junit/README.md b/governator-test-junit/README.md index 7f6dda23..26180ccb 100644 --- a/governator-test-junit/README.md +++ b/governator-test-junit/README.md @@ -8,6 +8,10 @@ To simplify integration testing of components wired together using Guice, you ma * Annotate dependencies with [@WrapWithSpy](https://github.com/Netflix/governator/blob/master/governator-test/src/main/java/com/netflix/governator/guice/test/WrapWithSpy.java) to wrap any binding with a Mockito spy. * Annotate parent classes, test classes, and/or test methods with [@TestPropertyOverride](https://github.com/Netflix/archaius/blob/2.x/archaius2-test/src/main/java/com/netflix/archaius/test/TestPropertyOverride.java) to set [Archaius2](https://github.com/Netflix/archaius/tree/2.x) property overrides for your Injector **(Note: You must include [ArchaiusModule](https://github.com/Netflix/archaius/blob/2.x/archaius2-guice/src/main/java/com/netflix/archaius/guice/ArchaiusModule.java) yourself in @ModulesForTesting to use this feature.)** +# Notes Tips and Tricks +* The `Injector` is created only once for each test class, and shared between all the tests. Each test class has a separate `Injector`. +* You can get hold of the `Injector` instance by `@Inject Injector`, though in general prefer to `@Inject` the actual object you want instead of the injector. + # Dependency Add the following to your build.gradle ``` From 361095c7994cce8d8cea5b8813fe324c40708a05 Mon Sep 17 00:00:00 2001 From: David Liu Date: Mon, 1 Jul 2019 16:21:15 -0700 Subject: [PATCH 2/2] Update README.md --- governator-test-junit/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/governator-test-junit/README.md b/governator-test-junit/README.md index 26180ccb..43079b6c 100644 --- a/governator-test-junit/README.md +++ b/governator-test-junit/README.md @@ -8,7 +8,7 @@ To simplify integration testing of components wired together using Guice, you ma * Annotate dependencies with [@WrapWithSpy](https://github.com/Netflix/governator/blob/master/governator-test/src/main/java/com/netflix/governator/guice/test/WrapWithSpy.java) to wrap any binding with a Mockito spy. * Annotate parent classes, test classes, and/or test methods with [@TestPropertyOverride](https://github.com/Netflix/archaius/blob/2.x/archaius2-test/src/main/java/com/netflix/archaius/test/TestPropertyOverride.java) to set [Archaius2](https://github.com/Netflix/archaius/tree/2.x) property overrides for your Injector **(Note: You must include [ArchaiusModule](https://github.com/Netflix/archaius/blob/2.x/archaius2-guice/src/main/java/com/netflix/archaius/guice/ArchaiusModule.java) yourself in @ModulesForTesting to use this feature.)** -# Notes Tips and Tricks +# Tips and Tricks * The `Injector` is created only once for each test class, and shared between all the tests. Each test class has a separate `Injector`. * You can get hold of the `Injector` instance by `@Inject Injector`, though in general prefer to `@Inject` the actual object you want instead of the injector.