提交 8389e3fc 编写于 作者: S Sam Brannen

Suppress warnings in Gradle build

上级 a530a1c7
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -258,6 +258,7 @@ public class PropertySourcesPropertyResolverTests { ...@@ -258,6 +258,7 @@ public class PropertySourcesPropertyResolverTests {
} }
@Test @Test
@SuppressWarnings("deprecation")
public void getPropertyAsClass() throws ClassNotFoundException, LinkageError { public void getPropertyAsClass() throws ClassNotFoundException, LinkageError {
MutablePropertySources propertySources = new MutablePropertySources(); MutablePropertySources propertySources = new MutablePropertySources();
propertySources.addFirst(new MockPropertySource().withProperty("some.class", SpecificType.class.getName())); propertySources.addFirst(new MockPropertySource().withProperty("some.class", SpecificType.class.getName()));
...@@ -266,6 +267,7 @@ public class PropertySourcesPropertyResolverTests { ...@@ -266,6 +267,7 @@ public class PropertySourcesPropertyResolverTests {
} }
@Test @Test
@SuppressWarnings("deprecation")
public void getPropertyAsClass_withInterfaceAsTarget() throws ClassNotFoundException, LinkageError { public void getPropertyAsClass_withInterfaceAsTarget() throws ClassNotFoundException, LinkageError {
MutablePropertySources propertySources = new MutablePropertySources(); MutablePropertySources propertySources = new MutablePropertySources();
propertySources.addFirst(new MockPropertySource().withProperty("some.class", SomeType.class.getName())); propertySources.addFirst(new MockPropertySource().withProperty("some.class", SomeType.class.getName()));
...@@ -274,6 +276,7 @@ public class PropertySourcesPropertyResolverTests { ...@@ -274,6 +276,7 @@ public class PropertySourcesPropertyResolverTests {
} }
@Test(expected = ConversionException.class) @Test(expected = ConversionException.class)
@SuppressWarnings("deprecation")
public void getPropertyAsClass_withMismatchedTypeForValue() { public void getPropertyAsClass_withMismatchedTypeForValue() {
MutablePropertySources propertySources = new MutablePropertySources(); MutablePropertySources propertySources = new MutablePropertySources();
propertySources.addFirst(new MockPropertySource().withProperty("some.class", "java.lang.String")); propertySources.addFirst(new MockPropertySource().withProperty("some.class", "java.lang.String"));
...@@ -282,6 +285,7 @@ public class PropertySourcesPropertyResolverTests { ...@@ -282,6 +285,7 @@ public class PropertySourcesPropertyResolverTests {
} }
@Test(expected = ConversionException.class) @Test(expected = ConversionException.class)
@SuppressWarnings("deprecation")
public void getPropertyAsClass_withNonExistentClassForValue() { public void getPropertyAsClass_withNonExistentClassForValue() {
MutablePropertySources propertySources = new MutablePropertySources(); MutablePropertySources propertySources = new MutablePropertySources();
propertySources.addFirst(new MockPropertySource().withProperty("some.class", "some.bogus.Class")); propertySources.addFirst(new MockPropertySource().withProperty("some.class", "some.bogus.Class"));
...@@ -290,6 +294,7 @@ public class PropertySourcesPropertyResolverTests { ...@@ -290,6 +294,7 @@ public class PropertySourcesPropertyResolverTests {
} }
@Test @Test
@SuppressWarnings("deprecation")
public void getPropertyAsClass_withObjectForValue() { public void getPropertyAsClass_withObjectForValue() {
MutablePropertySources propertySources = new MutablePropertySources(); MutablePropertySources propertySources = new MutablePropertySources();
propertySources.addFirst(new MockPropertySource().withProperty("some.class", new SpecificType())); propertySources.addFirst(new MockPropertySource().withProperty("some.class", new SpecificType()));
...@@ -298,6 +303,7 @@ public class PropertySourcesPropertyResolverTests { ...@@ -298,6 +303,7 @@ public class PropertySourcesPropertyResolverTests {
} }
@Test(expected = ConversionException.class) @Test(expected = ConversionException.class)
@SuppressWarnings("deprecation")
public void getPropertyAsClass_withMismatchedObjectForValue() { public void getPropertyAsClass_withMismatchedObjectForValue() {
MutablePropertySources propertySources = new MutablePropertySources(); MutablePropertySources propertySources = new MutablePropertySources();
propertySources.addFirst(new MockPropertySource().withProperty("some.class", new Integer(42))); propertySources.addFirst(new MockPropertySource().withProperty("some.class", new Integer(42)));
...@@ -306,6 +312,7 @@ public class PropertySourcesPropertyResolverTests { ...@@ -306,6 +312,7 @@ public class PropertySourcesPropertyResolverTests {
} }
@Test @Test
@SuppressWarnings("deprecation")
public void getPropertyAsClass_withRealClassForValue() { public void getPropertyAsClass_withRealClassForValue() {
MutablePropertySources propertySources = new MutablePropertySources(); MutablePropertySources propertySources = new MutablePropertySources();
propertySources.addFirst(new MockPropertySource().withProperty("some.class", SpecificType.class)); propertySources.addFirst(new MockPropertySource().withProperty("some.class", SpecificType.class));
...@@ -314,6 +321,7 @@ public class PropertySourcesPropertyResolverTests { ...@@ -314,6 +321,7 @@ public class PropertySourcesPropertyResolverTests {
} }
@Test(expected = ConversionException.class) @Test(expected = ConversionException.class)
@SuppressWarnings("deprecation")
public void getPropertyAsClass_withMismatchedRealClassForValue() { public void getPropertyAsClass_withMismatchedRealClassForValue() {
MutablePropertySources propertySources = new MutablePropertySources(); MutablePropertySources propertySources = new MutablePropertySources();
propertySources.addFirst(new MockPropertySource().withProperty("some.class", Integer.class)); propertySources.addFirst(new MockPropertySource().withProperty("some.class", Integer.class));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册