Table of Contents Stubs, Mocks, and Proxies Stub, Mock, and Proxy Testing with Testimonial Mock testing means unit testing with mock objects as substitutes for real objects. By real objects I mean the objects the tested unit (class) will be using in…
原文: https://code.google.com/p/googlemock/wiki/CookBook Creating Mock Classes Mocking Private or Protected Methods Mocking Overloaded Methods Mocking Class Templates Mocking Nonvirtual Methods Mocking Free Functions The Nice, the Strict, and the Naggy…
什么时候会用到代理proxy模式? 举一个例子:有两个应用App1和App2,它们都是受Cas服务器保护的,即请求它们时都需要通过Cas 服务器的认证.现在需要在App1中通过Http请求访问App2,显然该请求将会被App2配置的Cas的AuthenticationFilter拦截并转向Cas 服务器,Cas服务器将引导用户进行登录认证,这样我们也就访问不到App2的资源了.针对这种应用场景,Cas也提供了Cas Proxy 轻松的解决了这个问题. cas server 版本4.1.3 cas…