rafaelweingartner commented on a change in pull request #2776: Issue 2774: 
Changed the implementation of isVolumeOnManagedStorage(VolumeInfo) to…
URL: https://github.com/apache/cloudstack/pull/2776#discussion_r206849541
 
 

 ##########
 File path: 
engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
 ##########
 @@ -196,10 +196,16 @@ public StrategyPriority canHandle(DataObject srcData, 
DataObject destData) {
     }
 
     private boolean isVolumeOnManagedStorage(VolumeInfo volumeInfo) {
 
 Review comment:
   I was under the impression that Mike said because you are going to develop a 
test case (unit-ish) for  `canHandle`, we do not need the unit test case for 
`isVolumeOnManagedStorage`. And that is a problem. We should test methods as a 
unit. The test method for `canHandle` should not depend on ` 
isVolumeOnManagedStorage `, we should mock its (`isVolumeOnManagedStorage`) 
implementation instead.
   
   Also, the method `canHandle` is a little bit big, which can be a little 
problematic to test. Maybe if you extract the IFs body there (the ones with 
nested IFs) you would be able to more easily write the unit test for the 
`canHandle`.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to