use of com.agical.rmock.core.describe.ExpressionDescriber in project tomee by apache.
the class BasicClusterableRequestHandlerTest method testUpdateServerWhenRequestHashDiffersFromServerSideHash.
public void testUpdateServerWhenRequestHashDiffersFromServerSideHash() throws Exception {
final int port = SystemInstance.get().getOptions().get("ejbd.port", 4201);
final URI[] locations = new URI[] { new URI("ejbd://localhost:" + port) };
ServerMetaData server = new ServerMetaData(locations);
beanContext.setContainer(clusteredContainer);
request.getServerHash();
modify().returnValue(server.buildHash() + 1);
response.setServer(null);
modify().args(new AbstractExpression() {
@Override
public void describeWith(ExpressionDescriber arg0) throws IOException {
}
@Override
public boolean passes(Object arg0) {
ServerMetaData actualServer = (ServerMetaData) arg0;
assertSame(locations, actualServer.getLocations());
return true;
}
});
clusteredContainer.getLocations(beanContext);
modify().returnValue(locations);
startVerification();
requestHandler.updateServer(beanContext, request, response);
}
Aggregations