public static void defineAsCurrentResponse(final Context context, final byte[] responseBytes,
final String contentType, final String urlStr) {
final WebClient webClient = context.getWebClient();
final WebConnection originalConnection = webClient.getWebConnection();
try {
final MockWebConnection mockConnection = new MockWebConnection();
webClient.setWebConnection(mockConnection);
mockConnection.setDefaultResponse(responseBytes, 200, "ok", contentType);
// htmlUnit does't currently follow the "current window"
// check that our faked content will be loaded in what WebTest considers as the "current window"
// cf WT-293
final WebWindow currentTopWindow = context.getCurrentResponse().getEnclosingWindow().getTopWindow();