Reduce Mockito warnings (#2893)

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K 2022-04-03 22:36:55 +02:00 committed by GitHub
parent 7442220830
commit 2a3e2e5567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 39 additions and 39 deletions

View File

@ -59,7 +59,7 @@ import org.osgi.service.cm.ConfigurationAdmin;
* @author Jan N. Klug - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class AbstractRemoteAddonServiceTest {
private @Mock @NonNullByDefault({}) StorageService storageService;

View File

@ -38,7 +38,7 @@ import org.mockito.quality.Strictness;
*/
@NonNullByDefault
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
public class BundleVersionTest {
private static Stream<Arguments> provideCompareVersionsArguments() {

View File

@ -46,7 +46,7 @@ import org.osgi.service.http.HttpService;
* @author Henning Treu - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public abstract class AbstractAudioServletTest extends JavaTest {

View File

@ -45,7 +45,7 @@ import org.openhab.core.types.State;
* @author Christoph Weitkamp - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class ItemStateConditionHandlerTest {

View File

@ -40,7 +40,7 @@ import org.openhab.core.test.java.JavaTest;
* @author Simon Kaufmann - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class ConfigDescriptionRegistryTest extends JavaTest {

View File

@ -43,7 +43,7 @@ import org.openhab.core.test.java.JavaTest;
* @author Simon Kaufmann - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class MetadataConfigDescriptionProviderImplTest extends JavaTest {

View File

@ -63,7 +63,7 @@ import org.openhab.core.thing.type.ThingTypeRegistry;
* @author Henning Sudbrock - Added tests for auto-approving inbox entries
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class AutomaticInboxProcessorTest {

View File

@ -64,7 +64,7 @@ import org.openhab.core.thing.type.ThingTypeRegistry;
* @author Laurent Garnier - Added tests testApproveWithThingId and testApproveWithInvalidThingId
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class PersistentInboxTest {

View File

@ -37,7 +37,7 @@ import org.mockito.quality.Strictness;
* @author Markus Rathgeb - Base test classes without tests needs to be abstract
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public abstract class BaseHttpUtilTest {

View File

@ -45,7 +45,7 @@ import org.openhab.core.io.net.http.TlsTrustManagerProvider;
* @author Martin van Wingerden - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class ExtensibleTrustManagerImplTest {

View File

@ -44,7 +44,7 @@ import org.openhab.core.io.rest.LocaleService;
* @author Christoph Weitkamp - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class ConfigDescriptionResourceTest {

View File

@ -41,7 +41,7 @@ import org.openhab.core.items.MetadataRegistry;
* @author Henning Treu - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class MetadataSelectorMatcherTest {

View File

@ -64,7 +64,7 @@ import org.openhab.core.ui.items.ItemUIRegistry;
* @author Henning Treu - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class SitemapResourceTest extends JavaTest {

View File

@ -45,7 +45,7 @@ import org.mockito.quality.Strictness;
* @author Wouter Born - Migrate tests from Groovy to Java and use Mockito
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class CorsFilterTest {

View File

@ -42,7 +42,7 @@ import org.mockito.quality.Strictness;
* @author Wouter Born - Migrate tests from Groovy to Java and use Mockito
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class ProxyFilterTest {

View File

@ -68,7 +68,7 @@ import net.wimpi.modbus.util.SerialParameters;
* @author Sami Salonen - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class IntegrationTestSupport extends JavaTest {

View File

@ -44,7 +44,7 @@ import org.openhab.core.io.transport.upnp.UpnpIOParticipant;
* @author Andre Fuechsel - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class UpnpIOServiceTest {

View File

@ -40,7 +40,7 @@ import org.openhab.core.semantics.model.location.Indoor;
* @author Christoph Weitkamp - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
public class SemanticsTest {
private @Mock ItemRegistry mockedItemRegistry;

View File

@ -54,7 +54,7 @@ import org.openhab.core.persistence.PersistenceServiceRegistry;
* @author Jan N. Klug - Fix averageSince calculation
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class PersistenceExtensionsTest {

View File

@ -42,7 +42,7 @@ import org.openhab.core.library.items.SwitchItem;
*/
@NonNullByDefault
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
public class SemanticsMetadataProviderTest {
private static final String ITEM_NAME = "switchItem";

View File

@ -44,7 +44,7 @@ import org.osgi.framework.BundleContext;
* @author Christoph Weitkamp - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
class BaseDynamicCommandDescriptionProviderTest {

View File

@ -44,7 +44,7 @@ import org.osgi.framework.BundleContext;
* @author Christoph Weitkamp - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
class BaseDynamicStateDescriptionProviderTest {

View File

@ -61,7 +61,7 @@ import org.openhab.core.thing.type.ChannelTypeRegistry;
* @author Kai Kreuzer - added tests with multiple links
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class AutoUpdateManagerTest {

View File

@ -47,7 +47,7 @@ import org.osgi.framework.Bundle;
* @author Simon Kaufmann - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class ThingManagerImplTest {

View File

@ -85,7 +85,7 @@ import org.openhab.core.ui.items.ItemUIProvider;
* @author Kai Kreuzer - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class ItemUIRegistryImplTest {

View File

@ -48,7 +48,7 @@ import org.osgi.service.http.HttpService;
* @author Kai Kreuzer - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class ProxyServletServiceTest {

View File

@ -39,7 +39,7 @@ import org.openhab.core.scheduler.ScheduledCompletableFuture;
* @author Hilbrand Bouwkamp - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class DelegatedSchedulerTest {

View File

@ -45,7 +45,7 @@ import org.openhab.core.types.util.UnitUtils;
* @author Stefan Triller - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class NumberItemTest {

View File

@ -36,7 +36,7 @@ import org.osgi.framework.ServiceReference;
* @author Henning Treu - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class HttpServiceUtilTest {

View File

@ -39,7 +39,7 @@ import org.openhab.core.config.discovery.usbserial.linuxsysfs.testutil.UsbSerial
* @author Henning Sudbrock - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class PollingUsbSerialScannerTest {

View File

@ -66,7 +66,7 @@ import com.jayway.jsonpath.JsonPath;
* @author Henning Treu - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class ItemResourceOSGiTest extends JavaOSGiTest {

View File

@ -55,7 +55,7 @@ import com.jayway.jsonpath.JsonPath;
* @author Christoph Weitkamp - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class ItemChannelLinkResourceOSGiTest extends JavaOSGiTest {

View File

@ -49,7 +49,7 @@ import org.openhab.core.thing.type.ChannelTypeUID;
* @author Stefan Triller - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class ProfileTypeResourceTest extends JavaTest {

View File

@ -46,7 +46,7 @@ import org.osgi.framework.ServiceRegistration;
* @author Simon Kaufmann - migrated from Groovy to Java
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class OSGiEventManagerOSGiTest extends JavaOSGiTest {

View File

@ -75,7 +75,7 @@ import tech.units.indriya.unit.Units;
* @author Stefan Triller - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class GroupItemOSGiTest extends JavaOSGiTest {

View File

@ -95,7 +95,7 @@ import org.osgi.service.component.ComponentContext;
* @author Wouter Born - Migrate tests from Groovy to Java
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@SuppressWarnings("null")
@NonNullByDefault
public class BindingBaseClassesOSGiTest extends JavaOSGiTest {

View File

@ -88,7 +88,7 @@ import org.openhab.core.types.StateDescriptionFragmentBuilder;
* @author Simon Kaufmann - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class CommunicationManagerOSGiTest extends JavaOSGiTest {

View File

@ -84,7 +84,7 @@ import org.osgi.framework.Bundle;
* thing UID and firmware version
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class FirmwareUpdateServiceTest extends JavaOSGiTest {

View File

@ -49,7 +49,7 @@ import org.openhab.core.thing.type.ChannelType;
* @author Simon Kaufmann - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.WARN)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
public class SystemProfileFactoryOSGiTest extends JavaOSGiTest {