@Test (groups = "unit", testName = "client.hotrod.TransportObjectFactoryTest")
public class TransportObjectFactoryTest {
public void testValidate() {
Codec codec = mock(Codec.class);
TransportObjectFactory objectFactory = new TransportObjectFactory(codec, null,
new AtomicInteger(), false);
doThrow(new TransportException("induced!", null))
.when(codec).writeHeader(any(Transport.class), any(HeaderParams.class));
InetSocketAddress address = new InetSocketAddress(123);
assertFalse("Exception shouldn't be thrown here", objectFactory.validateObject(address, any(TcpTransport.class)));
}