DaanHoogland commented on code in PR #8099:
URL: https://github.com/apache/cloudstack/pull/8099#discussion_r1360213262


##########
utils/src/test/java/com/cloud/utils/SwiftUtilTest.java:
##########
@@ -215,15 +174,20 @@ public void 
testListContainerCmdWithStoragePolicyButNotSupportedByOperation() {
 
     @Test
     public void testListContainerCmdWithoutStoragePolicy() {
-        SwiftClientCfg cfg = mock(SwiftClientCfg.class);
-        given(cfg.getEndPoint()).willReturn("swift.endpoint");
-        given(cfg.getAccount()).willReturn("cs");
-        given(cfg.getUserName()).willReturn("sec-storage");
-        given(cfg.getKey()).willReturn("mypassword");
-        given(cfg.getStoragePolicy()).willReturn(null);
+        SwiftClientCfg cfg = CreateMockSwiftClientCfg(null);
 
         String uploadCmd = SwiftUtil.getSwiftContainerCmd(cfg, "swift", 
"list", "T-1");
         String expected = "/usr/bin/python swift -A swift.endpoint -U 
cs:sec-storage -K mypassword list T-1";
         assertThat(uploadCmd, is(equalTo(expected)));
     }
+
+    private SwiftClientCfg CreateMockSwiftClientCfg(String policy){
+        SwiftClientCfg cfg = mock(SwiftClientCfg.class);//

Review Comment:
   ```suggestion
           SwiftClientCfg cfg = mock(SwiftClientCfg.class);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to