You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/09/06 18:51:44 UTC

[GitHub] [commons-collections] wx930910 opened a new pull request #249: replace TestBuilder with mocking object to improve test design

wx930910 opened a new pull request #249:
URL: https://github.com/apache/commons-collections/pull/249


   Fix [COLLECTIONS-798](https://issues.apache.org/jira/browse/COLLECTIONS-798)
   
   ### Description
   
   #### Replace test class [TestBuilder](https://github.com/apache/commons-collections/blob/3aae82cbaaaf539bf3f54cd6a0679efc123f2c8e/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/HasherBuilderTest.java#L41) by mocking object and improve test design.
   <hr>
   
   ##### Motivation
   
    - Decouple test class {{TestBuilder}} from production interface {{Builder}}.
    - Make test logic more clear by using method stub instead of method overriding.
    - Make test condition more explict by use local variable in test case.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    - Created mocking object to replace test subclass `TestBuilder`, decoupled test from production code.
    - Extract `items` as a local variable to improve test logic and make test condition more explict.
    - Make test logic more clear by using method stub instead of method overriding.
    - Add Mockito dependency.
   
   <hr>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-collections] kinow commented on pull request #249: replace TestBuilder with mocking object to improve test design

Posted by GitBox <gi...@apache.org>.
kinow commented on pull request #249:
URL: https://github.com/apache/commons-collections/pull/249#issuecomment-914054353


   > @kinow Thanks for your reminder! I just revised the code format and it passed the Travis CI. The GH Actions won't run automatically since I am a First-time contributor and need a maintainer to approve running workflows.
   
   Oh, just approved the run, it should start shortly. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-collections] wx930910 commented on pull request #249: replace TestBuilder with mocking object to improve test design

Posted by GitBox <gi...@apache.org>.
wx930910 commented on pull request #249:
URL: https://github.com/apache/commons-collections/pull/249#issuecomment-913989110


   @kinow Thanks for your reminder! I just revised the code format and it passed the Travis CI. The GH Actions won't run automatically since I am a First-time contributor and need a maintainer to approve running workflows.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-collections] coveralls commented on pull request #249: replace TestBuilder with mocking object to improve test design

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #249:
URL: https://github.com/apache/commons-collections/pull/249#issuecomment-913988630


   
   [![Coverage Status](https://coveralls.io/builds/42688222/badge)](https://coveralls.io/builds/42688222)
   
   Coverage remained the same at 90.143% when pulling **1d533c9547a33a2b257a3bd77a9572b1edb8574e on wx930910:refactor-testBuilder** into **ddb4f78cfffc3392d897f7d59b75db946bf3a055 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org