Skip to content

Commit de60734

Browse files
committed
make test method package protected
1 parent dc2a9d6 commit de60734

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/AsyncHttpResourceHelper.java

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,46 +24,44 @@
2424
class AsyncHttpResourceHelper {
2525

2626
@SuppressWarnings("unchecked")
27-
public static ActionListener<Boolean> mockBooleanActionListener() {
27+
static ActionListener<Boolean> mockBooleanActionListener() {
2828
return mock(ActionListener.class);
2929
}
3030

31-
public static void whenPerformRequestAsyncWith(final RestClient client, final Response response) {
31+
static void whenPerformRequestAsyncWith(final RestClient client, final Response response) {
3232
doAnswer(invocation -> {
3333
((ResponseListener)invocation.getArguments()[1]).onSuccess(response);
3434
return null;
3535
}).when(client).performRequestAsync(any(Request.class), any(ResponseListener.class));
3636
}
3737

38-
public static void whenPerformRequestAsyncWith(final RestClient client, final Matcher<Request> request, final Response response) {
38+
static void whenPerformRequestAsyncWith(final RestClient client, final Matcher<Request> request, final Response response) {
3939
doAnswer(invocation -> {
4040
((ResponseListener)invocation.getArguments()[1]).onSuccess(response);
4141
return null;
4242
}).when(client).performRequestAsync(argThat(request), any(ResponseListener.class));
4343
}
4444

45-
public static void whenPerformRequestAsyncWith(final RestClient client,
46-
final Matcher<Request> request,
47-
final List<Response> responses) {
45+
static void whenPerformRequestAsyncWith(final RestClient client, final Matcher<Request> request, final List<Response> responses) {
4846
if (responses.size() == 1) {
4947
whenPerformRequestAsyncWith(client, request, responses.get(0));
5048
} else if (responses.size() > 1) {
5149
whenPerformRequestAsyncWith(client, request, responses.get(0), responses.subList(1, responses.size()), null);
5250
}
5351
}
5452

55-
public static void whenPerformRequestAsyncWith(final RestClient client,
56-
final Matcher<Request> request,
57-
final Response response,
58-
final Exception exception) {
53+
static void whenPerformRequestAsyncWith(final RestClient client,
54+
final Matcher<Request> request,
55+
final Response response,
56+
final Exception exception) {
5957
whenPerformRequestAsyncWith(client, request, response, null, exception);
6058
}
6159

62-
public static void whenPerformRequestAsyncWith(final RestClient client,
63-
final Matcher<Request> request,
64-
final Response first,
65-
final List<Response> responses,
66-
final Exception exception) {
60+
static void whenPerformRequestAsyncWith(final RestClient client,
61+
final Matcher<Request> request,
62+
final Response first,
63+
final List<Response> responses,
64+
final Exception exception) {
6765
Stubber stub = doAnswer(invocation -> {
6866
((ResponseListener)invocation.getArguments()[1]).onSuccess(first);
6967
return null;
@@ -88,28 +86,28 @@ public static void whenPerformRequestAsyncWith(final RestClient client,
8886
stub.when(client).performRequestAsync(argThat(request), any(ResponseListener.class));
8987
}
9088

91-
public static void whenPerformRequestAsyncWith(final RestClient client, final Request request, final Response response) {
89+
static void whenPerformRequestAsyncWith(final RestClient client, final Request request, final Response response) {
9290
doAnswer(invocation -> {
9391
((ResponseListener)invocation.getArguments()[1]).onSuccess(response);
9492
return null;
9593
}).when(client).performRequestAsync(eq(request), any(ResponseListener.class));
9694
}
9795

98-
public static void whenPerformRequestAsyncWith(final RestClient client, final Exception exception) {
96+
static void whenPerformRequestAsyncWith(final RestClient client, final Exception exception) {
9997
doAnswer(invocation -> {
10098
((ResponseListener)invocation.getArguments()[1]).onFailure(exception);
10199
return null;
102100
}).when(client).performRequestAsync(any(Request.class), any(ResponseListener.class));
103101
}
104102

105-
public static void whenPerformRequestAsyncWith(final RestClient client, final Matcher<Request> request, final Exception exception) {
103+
static void whenPerformRequestAsyncWith(final RestClient client, final Matcher<Request> request, final Exception exception) {
106104
doAnswer(invocation -> {
107105
((ResponseListener)invocation.getArguments()[1]).onFailure(exception);
108106
return null;
109107
}).when(client).performRequestAsync(argThat(request), any(ResponseListener.class));
110108
}
111109

112-
public static void whenPerformRequestAsyncWith(final RestClient client, final Request request, final Exception exception) {
110+
static void whenPerformRequestAsyncWith(final RestClient client, final Request request, final Exception exception) {
113111
doAnswer(invocation -> {
114112
((ResponseListener)invocation.getArguments()[1]).onFailure(exception);
115113
return null;

0 commit comments

Comments
 (0)