4 ms·
Subclasing and overriding is not a good idea. There is no compilation failure if you forget to override a function which can lead to flakey tests at best and pr
by sunnybeetroot 9mo ago
Subclasing and overriding is not a good idea. There is no compilation failure if you forget to override a function which can lead to flakey tests at best and prod data impact at worst.
- wmichelin 9mo agoyour test environment should not have the credentials to write to prod data. yiiiiikes!
- sunnybeetroot 9mo agoCredentials end up existing in prod because the person used Mochito and didn’t override the function for providing credentials :’c
- senbrow 9mo agoCredentials should only be provided at the application root, which is going to be a different root for a test harness. Mockito shouldn't change whether or not this is possible; the code shouldn't have the prod creds (or any external resource references) hard coded in the compiled bytecode.
- sunnybeetroot 9mo agoI totally agree, I’m being tongue in cheek, but given how poor some codebases can be, the more precautions the better ie compilation failures on non-mocked functions.