-
Notifications
You must be signed in to change notification settings - Fork 12
Introduce StorageFactorySwitch
#289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Current coverage is 86.08% (diff: 91.66%)@@ master #289 diff @@
==========================================
Files 191 192 +1
Lines 6572 6618 +46
Methods 0 0
Messages 0 0
Branches 641 649 +8
==========================================
+ Hits 5652 5697 +45
Misses 807 807
- Partials 113 114 +1
|
Also test for parameterless ctor in `StorageFactorySwitch`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexander-yevsyukov please see my comments.
* a {@code Supplier} for tests was not set via {@link #init(Supplier, Supplier)}. | ||
* | ||
* <h2>Production mode</h2> | ||
* <p>In production mode this class obtains the instance obtained |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...obtains the instance obtained...
looks weird.
I think obtains the instance provided by the
will do the job.
* <h2>Production mode</h2> | ||
* <p>In production mode this class obtains the instance obtained | ||
* by the {@code Supplier} passed via {@link #init(Supplier, Supplier)}. | ||
* If the production {@code Supplier} was not initialized {@code IllegalStateException} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, a comma after the not initialized
would improve the readability.
@VisibleForTesting | ||
static final String ENV_KEY_APP_ENGINE_RUNTIME_VERSION = "com.google.appengine.runtime.version"; | ||
|
||
/** If set contains the version of AppEngine obtained from the system property. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a comma after If set
.
} | ||
|
||
/** | ||
* Turns the environment into tests mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, Switches ...
?
Or maybe Turns on the test mode for the environment.
?
} | ||
|
||
/** | ||
* Cleans the `storageFactorySwitch` instance by nullifying fields. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, clear
will be more suitable as an action verb for the intention like this.
Another option to consider is restore
, if you want to emphasise the returning to the original state.
|
||
@Test | ||
public void cache_instance_of_StorageFactory_in_testing() { | ||
Supplier<StorageFactory> testingSupplier = spy(inMemorySupplier); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final
?
|
||
@Test | ||
public void cache_instance_of_StorageFactory_in_production() { | ||
Supplier<StorageFactory> productionSupplier = spy(inMemorySupplier); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final
?
@armiol PTAL |
Also addressed missed `final` for test var.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexander-yevsyukov LGTM.
No description provided.