Skip to content

Commit

Permalink
changing anonymous subclass to lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
James Kerak committed Nov 10, 2016
1 parent 6708feb commit 997b3ca
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,10 @@ public void whenGetUploadFileProgress_thenCorrect() throws IOException {
.build();


ProgressRequestWrapper.ProgressListener listener = new ProgressRequestWrapper.ProgressListener() {
ProgressRequestWrapper.ProgressListener listener = (bytesWritten, contentLength) -> {

public void onRequestProgress(long bytesWritten, long contentLength) {

float percentage = 100f * bytesWritten / contentLength;
assertFalse(Float.compare(percentage, 100) > 0);
}
float percentage = 100f * bytesWritten / contentLength;
assertFalse(Float.compare(percentage, 100) > 0);
};

ProgressRequestWrapper countingBody = new ProgressRequestWrapper(requestBody, listener);
Expand Down

0 comments on commit 997b3ca

Please sign in to comment.