private boolean doesRequestMatch(Record request) { if(null == expectedRequest) return true; if(null == request) return false; if(request instanceof Streamable) { try { Streamable streamableRequest = (Streamable)request; ByteArrayOutputStream stream = new ByteArrayOutputStream(); streamableRequest.write(stream); stream.flush(); return Arrays.equals(expectedRequest, stream.toByteArray()); } catch(Exception exc) { throw new NestedApplicationException(exc); } } return false; }
((Streamable)actualResponse).read(new ByteArrayInputStream(responseData));
((Streamable)actualResponse).read(new ByteArrayInputStream(responseData));
((Streamable)actualResponse).read(new ByteArrayInputStream(responseData));
private boolean doesRequestMatch(Record request) { if(null == expectedRequest) return true; if(null == request) return false; if(request instanceof Streamable) { try { Streamable streamableRequest = (Streamable)request; ByteArrayOutputStream stream = new ByteArrayOutputStream(); streamableRequest.write(stream); stream.flush(); return Arrays.equals(expectedRequest, stream.toByteArray()); } catch(Exception exc) { throw new NestedApplicationException(exc); } } return false; }
response.read(new ByteArrayInputStream(responseData));
private boolean doesRequestMatch(Record request) { if(null == expectedRequest) return true; if(null == request) return false; if(request instanceof Streamable) { try { Streamable streamableRequest = (Streamable)request; ByteArrayOutputStream stream = new ByteArrayOutputStream(); streamableRequest.write(stream); stream.flush(); return Arrays.equals(expectedRequest, stream.toByteArray()); } catch(Exception exc) { throw new NestedApplicationException(exc); } } return false; }
response.read(new ByteArrayInputStream(responseData));
response.read(new ByteArrayInputStream(responseData));