Skip to content

Conversation

@liubao68
Copy link
Contributor

@liubao68 liubao68 commented Dec 5, 2017

…ation

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 86.918% when pulling e107195 on liubao68:option_ssl into f8893fd on ServiceComb:master.

@liubao68 liubao68 changed the title Fix bug that when booting use java system properties for ssl configuration [JAV-554]Fix bug that when booting use java system properties for ssl configuration Dec 5, 2017
@Test
public void testSSLOptionYamlOptionWithProperyFalse() throws Exception {
System.setProperty("ssl.authPeer", "false");
DynamicConfiguration configFromYamlFile =
Copy link
Member

Choose a reason for hiding this comment

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

The below code is duplicated code, it's better to extract a method for setting up the configuration from system property.

Copy link
Contributor Author

@liubao68 liubao68 Dec 6, 2017

Choose a reason for hiding this comment

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

For unit test case, I think it quite important to make each test have only one logic (that is to say, code complexity is one) and code duplication is not a concern. If I extract a method, there got an "if" statement that make complexity is two. So I used to copy code for new test cases.

@Test
public void testSSLOptionYamlOptionWithProperyTrue() throws Exception {
System.setProperty("ssl.authPeer", "true");
DynamicConfiguration configFromYamlFile =
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems that finalConfig equals io.servicecomb.config.ConfigUtil.createLocalConfig() result?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 86.92% when pulling c476a39 on liubao68:option_ssl into f8893fd on ServiceComb:master.

@WillemJiang WillemJiang merged commit 2f5f51c into apache:master Dec 8, 2017
@liubao68 liubao68 deleted the option_ssl branch January 5, 2018 07: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.

4 participants