Skip to content

Conversation

alexander-yevsyukov
Copy link
Contributor

No description provided.

@codecov-io
Copy link

codecov-io commented Jan 26, 2017

Current coverage is 86.08% (diff: 91.66%)

Merging #289 into master will increase coverage by 0.08%

@@             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   

Powered by Codecov. Last update 4dcc9eb...259a5a2

Also test for parameterless ctor in `StorageFactorySwitch`.
Copy link
Contributor

@armiol armiol left a 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
Copy link
Contributor

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}
Copy link
Contributor

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. */
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

final?

@alexander-yevsyukov
Copy link
Contributor Author

@armiol PTAL

Also addressed missed `final` for test var.
Copy link
Contributor

@armiol armiol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexander-yevsyukov alexander-yevsyukov merged commit 337c505 into master Jan 27, 2017
@alexander-yevsyukov alexander-yevsyukov deleted the storage-factory-switch branch January 27, 2017 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants