@Test(expected=IllegalArgumentException.class) public void testExpectTwice() throws IOException { StaticConnectionFactory.expectCall().andReturn(DATA2); StaticConnectionFactory.expectCall().andReturn(DATA1); }
public synchronized static UniversalMockRecorder expectCall() { if (getConnectionFactory()==null) { UniversalMockConnectionFactory mockConnection = new UniversalMockConnectionFactory(); useConnectionFactory(mockConnection); return mockConnection; } else { throw new IllegalArgumentException("Can not call expectCall twice. You have to call reset before each test. If you need simulate multiple requests, please call andReturn several times."); } }
StaticConnectionFactory implements ConnectionFactory { public synchronized static UniversalMockRecorder expectCall() { if (getConnectionFactory()==null) { UniversalMockConnectionFactory mockConnection = new UniversalMockConnectionFactory(); useConnectionFactory(mockConnection); return mockConnection; } else { throw new IllegalArgumentException("Can not call expectCall twice. You have to call reset before each test. If you need simulate multiple requests, please call andReturn several times."); } } }
StaticConnectionFactory implements ConnectionFactory { public synchronized static UniversalMockRecorder expectCall() { if (getConnectionFactory()==null) { UniversalMockConnectionFactory mockConnection = new UniversalMockConnectionFactory(); useConnectionFactory(mockConnection); return mockConnection; } else { throw new IllegalArgumentException("Can not call expectCall twice. You have to call reset before each test. If you need simulate multiple requests, please call andReturn several times."); } }  }
StaticConnectionFactory implements ConnectionFactory { public synchronized static UniversalMockRecorder expectCall() { if (getConnectionFactory()==null) { UniversalMockConnectionFactory mockConnection = new UniversalMockConnectionFactory(); useConnectionFactory(mockConnection); return mockConnection; } else { throw new IllegalArgumentException("Can not call expectCall twice. You have to call reset before each test. If you need simulate multiple requests, please call andReturn several times."); } }  synchronized Connection createConnection(String address); synchronized static UniversalMockRecorder expectCall(); synchronized static void reset(); static void useConnectionFactory(ConnectionFactory connectionFactory); synchronized static RequestRecorder getRequestRecorder(); }
StaticConnectionFactory implements ConnectionFactory { public synchronized static UniversalMockRecorder expectCall() { if (getConnectionFactory()==null) { UniversalMockConnectionFactory mockConnection = new UniversalMockConnectionFactory(); useConnectionFactory(mockConnection); return mockConnection; } else { throw new IllegalArgumentException("Can not call expectCall twice. You have to call reset before each test. If you need simulate multiple requests, please call andReturn several times."); } }  synchronized Connection createConnection(String address); synchronized static UniversalMockRecorder expectCall(); synchronized static void reset(); static void useConnectionFactory(ConnectionFactory connectionFactory); synchronized static RequestRecorder getRequestRecorder();  }