I read several tutorials and manuals but all of them skips the part that I actually need, which is the actual part where you run the stuff.
My scenario is as follows.
I have a Connection
interface:
public interface Connection {
void open(Selector selector);
void send(NetMessage message);
}
I have a production implementation that needs a SocketFactory
:
public class ConnectionImpl implements Connection {
// members
@Inject
public ConnectionImpl(@Assisted SecurityMode securityMode, @Assisted long connectionId,
@Assisted EntityAddresses addresses, SocketFactory socketFactory)
So I created a ConnectionFactory
:
public interface ConnectionFactory {
SioConnection create(SecurityMode securityMode, long connectionId, EntityAddresses addresses);
}
Now, I have two implementations of SocketFactory
: SocketFactoryProd
and SocketFactoryTest
.
I am creating a Test for Connection
and I want to create a ConnectionImpl
with SocketFactoryTest
, and I really don't get how I do exactly. This is the part that I keep on missing, what I should write in my test (or in the test class setUp
).