Skip to content

Commit b367b7b

Browse files
author
Tom Akehurst
committed
Switched BodyChunker to use the configured notifier rather than creating its own
1 parent dac7adb commit b367b7b

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

src/main/java/com/github/tomakehurst/wiremock/servlet/BodyChunker.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2021 Thomas Akehurst
2+
* Copyright (C) 2017-2022 Thomas Akehurst
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,28 +15,27 @@
1515
*/
1616
package com.github.tomakehurst.wiremock.servlet;
1717

18-
import com.github.tomakehurst.wiremock.common.Notifier;
19-
import com.github.tomakehurst.wiremock.common.Slf4jNotifier;
18+
import static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;
19+
2020
import java.util.Arrays;
2121

2222
public class BodyChunker {
2323

24-
private static final Notifier notifier = new Slf4jNotifier(false);
25-
2624
public static byte[][] chunkBody(byte[] body, int numberOfChunks) {
2725

2826
if (numberOfChunks < 1) {
29-
notifier.error("Number of chunks set to value less than 1: " + numberOfChunks);
27+
notifier().error("Number of chunks set to value less than 1: " + numberOfChunks);
3028
numberOfChunks = 1;
3129
}
3230

3331
if (body.length < numberOfChunks) {
34-
notifier.error(
35-
"Number of chunks set to value greater then body length. Number of chunks: "
36-
+ numberOfChunks
37-
+ ". Body length: "
38-
+ body.length
39-
+ ". Overriding number of chunks to body length.");
32+
notifier()
33+
.error(
34+
"Number of chunks set to value greater then body length. Number of chunks: "
35+
+ numberOfChunks
36+
+ ". Body length: "
37+
+ body.length
38+
+ ". Overriding number of chunks to body length.");
4039
numberOfChunks = body.length;
4140
}
4241

0 commit comments

Comments
 (0)