|
46 | 46 | import org.elasticsearch.xpack.ml.notifications.InferenceAuditor;
|
47 | 47 | import org.junit.After;
|
48 | 48 | import org.junit.Before;
|
49 |
| -import org.mockito.ArgumentMatcher; |
50 | 49 | import org.mockito.Mockito;
|
51 | 50 |
|
52 | 51 | import java.io.IOException;
|
|
62 | 61 | import static org.hamcrest.Matchers.not;
|
63 | 62 | import static org.hamcrest.Matchers.nullValue;
|
64 | 63 | import static org.mockito.Matchers.any;
|
65 |
| -import static org.mockito.Matchers.argThat; |
66 | 64 | import static org.mockito.Matchers.eq;
|
67 | 65 | import static org.mockito.Mockito.atMost;
|
68 | 66 | import static org.mockito.Mockito.doAnswer;
|
@@ -140,12 +138,6 @@ public void testGetCachedModels() throws Exception {
|
140 | 138 | assertThat(future.get(), is(not(nullValue())));
|
141 | 139 | }
|
142 | 140 |
|
143 |
| - verify(trainedModelStatsService, times(1)).queueStats(argThat(new ArgumentMatcher<InferenceStats>() { |
144 |
| - @Override |
145 |
| - public boolean matches(final Object o) { |
146 |
| - return ((InferenceStats)o).getModelId().equals(model3); |
147 |
| - } |
148 |
| - })); |
149 | 141 | verify(trainedModelProvider, times(1)).getTrainedModel(eq(model1), eq(true), any());
|
150 | 142 | verify(trainedModelProvider, times(1)).getTrainedModel(eq(model2), eq(true), any());
|
151 | 143 | // It is not referenced, so called eagerly
|
@@ -192,24 +184,6 @@ public void testMaxCachedLimitReached() throws Exception {
|
192 | 184 | verify(trainedModelProvider, atMost(2)).getTrainedModel(eq(model2), eq(true), any());
|
193 | 185 | // Only loaded requested once on the initial load from the change event
|
194 | 186 | verify(trainedModelProvider, times(1)).getTrainedModel(eq(model3), eq(true), any());
|
195 |
| - verify(trainedModelStatsService, atMost(2)).queueStats(argThat(new ArgumentMatcher<InferenceStats>() { |
196 |
| - @Override |
197 |
| - public boolean matches(final Object o) { |
198 |
| - return ((InferenceStats)o).getModelId().equals(model1); |
199 |
| - } |
200 |
| - })); |
201 |
| - verify(trainedModelStatsService, atMost(2)).queueStats(argThat(new ArgumentMatcher<InferenceStats>() { |
202 |
| - @Override |
203 |
| - public boolean matches(final Object o) { |
204 |
| - return ((InferenceStats)o).getModelId().equals(model2); |
205 |
| - } |
206 |
| - })); |
207 |
| - verify(trainedModelStatsService, times(1)).queueStats(argThat(new ArgumentMatcher<InferenceStats>() { |
208 |
| - @Override |
209 |
| - public boolean matches(final Object o) { |
210 |
| - return ((InferenceStats)o).getModelId().equals(model3); |
211 |
| - } |
212 |
| - })); |
213 | 187 |
|
214 | 188 | // Load model 3, should invalidate 1
|
215 | 189 | for(int i = 0; i < 10; i++) {
|
|
0 commit comments