This is a very simple example of what I meant in the comments:
type CassAPI interface { GetFoo(rowKey string) (someType, error) } type CassWrapper struct { cass *gocql.Session } func (cw *CassWrapper) GetFoo(rowKey string) (someType, error) {
The application code uses an instance of CassWrapper, and the tests will use an instance of some layout or stub that is bound to the same CassAPI interface.
source share