Does it only hang in Java 7? Usually when mockt ests hang is because a request is made and the code is waiting for the response. If mockwevserver does not have more responses configured, it just waits until the connection times out.