cldfs.Client methods however might make multiple callouts for their utility, and since the implementation of these methods is part of managed package code, you can't set mocks for individual callouts using Test.setMock

CloudFiles thus provides another class cldfs.ClientFactory which automatically returns mocked responses depending on the context i.e Test/Runtime.

This section covers details on how to get coverage for your classes utilizing CloudFiles' methods including simple and complex examples.

About ClientFactory - As the name suggests, cldfs.ClientFactory is a class built on the Factory pattern which returns a runtime instance or a test instance depending on the context. Read this article to know more.