Replace casted Mockito.any() calls

Closes gh-11817
This commit is contained in:
dreis2211
2018-01-28 17:29:35 +01:00
committed by Stephane Nicoll
parent ab02e48c44
commit a7663c88d3
16 changed files with 41 additions and 41 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -178,8 +178,8 @@ public class RemoteClientConfigurationTests {
public Dispatcher dispatcher() throws IOException {
Dispatcher dispatcher = mock(Dispatcher.class);
ServerHttpRequest anyRequest = (ServerHttpRequest) any();
ServerHttpResponse anyResponse = (ServerHttpResponse) any();
ServerHttpRequest anyRequest = any(ServerHttpRequest.class);
ServerHttpResponse anyResponse = any(ServerHttpResponse.class);
given(dispatcher.handle(anyRequest, anyResponse)).willReturn(true);
return dispatcher;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ public class MockRestarter implements TestRule {
private void setup() {
Restarter.setInstance(this.mock);
given(this.mock.getInitialUrls()).willReturn(new URL[] {});
given(this.mock.getOrAddAttribute(anyString(), (ObjectFactory) any()))
given(this.mock.getOrAddAttribute(anyString(), any(ObjectFactory.class)))
.willAnswer((invocation) -> {
String name = (String) invocation.getArguments()[0];
ObjectFactory factory = (ObjectFactory) invocation.getArguments()[1];

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -78,7 +78,7 @@ public class OnInitializedRestarterConditionTests {
public static void main(String... args) {
RestartInitializer initializer = mock(RestartInitializer.class);
given(initializer.getInitialUrls((Thread) any())).willReturn(new URL[0]);
given(initializer.getInitialUrls(any(Thread.class))).willReturn(new URL[0]);
Restarter.initialize(new String[0], false, initializer);
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(
Config.class);