This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new 94682366b Unit test modernization.
94682366b is described below
commit 94682366be92b6924bbbe8a1369028f0e1d4b9ea
Author: James Bognar <[email protected]>
AuthorDate: Thu Jul 31 13:25:50 2025 -0400
Unit test modernization.
---
.../juneau/assertions/AnyAssertion_Test.java | 98 +++++++++++-----------
.../juneau/config/ConfigMapListenerTest.java | 3 +-
.../java/org/apache/juneau/cp/BeanStore_Test.java | 4 +-
.../http/annotation/AnnotationUtils_Test.java | 26 +++---
.../org/apache/juneau/http/header/Accept_Test.java | 2 +-
.../org/apache/juneau/reflect/MethodInfoTest.java | 20 ++---
.../org/apache/juneau/reflect/ParamInfoTest.java | 8 +-
.../client/RestClient_Config_RestClient_Test.java | 9 +-
.../rest/client/RestClient_Response_Body_Test.java | 3 +-
.../apache/juneau/rest/client/RestClient_Test.java | 4 +-
.../java/org/apache/juneau/xml/BasicXmlTest.java | 2 +-
11 files changed, 87 insertions(+), 92 deletions(-)
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/assertions/AnyAssertion_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/assertions/AnyAssertion_Test.java
index 8be924cf7..b4cce9a32 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/assertions/AnyAssertion_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/assertions/AnyAssertion_Test.java
@@ -58,13 +58,13 @@ public class AnyAssertion_Test {
//-----------------------------------------------------------------------------------------------------------------
@Test
- public void a01_msg() throws Exception {
+ public void a01_msg() {
assertThrown(()->test(null).setMsg("Foo {0}",
1).isExists()).asMessage().is("Foo 1");
assertThrown(()->test(null).setMsg("Foo {0}",
1).setThrowable(RuntimeException.class).isExists()).isExactType(RuntimeException.class).asMessage().is("Foo
1");
}
@Test
- public void a02_stdout() throws Exception {
+ public void a02_stdout() {
test(null).setStdOut();
}
@@ -73,14 +73,14 @@ public class AnyAssertion_Test {
//-----------------------------------------------------------------------------------------------------------------
@Test
- public void ba01a_asString() throws Exception {
+ public void ba01a_asString() {
Integer x = 1, nil = null;
test(x).asString().is("1");
test(nil).asString().isNull();
}
@Test
- public void ba01b_asString_wSerializer() throws Exception {
+ public void ba01b_asString_wSerializer() {
Integer x = 1, nil = null;
WriterSerializer s = Json5Serializer.DEFAULT;
test(x).asString(s).is("1");
@@ -88,13 +88,13 @@ public class AnyAssertion_Test {
}
@Test
- public void ba01c_asString_wPredicate() throws Exception {
+ public void ba01c_asString_wPredicate() {
Integer x1 = 1;
test(x1).asString(x -> "foo").is("foo");
}
@Test
- public void ba02_asJson() throws Exception {
+ public void ba02_asJson() {
Integer x = 1, nil = null;
test(x).asJson().is("1");
test(nil).asJson().is("null");
@@ -102,7 +102,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ba03_asJsonSorted() throws Exception {
+ public void ba03_asJsonSorted() {
Integer[] x1 = {2,1}, nil = null;
Object x2 = new A1();
test(x1).asJsonSorted().is("[1,2]");
@@ -111,13 +111,13 @@ public class AnyAssertion_Test {
}
@Test
- public void ba04_apply() throws Exception {
+ public void ba04_apply() {
Integer x1 = 1, x2 = 2;
test(x1).asTransformed(x -> x2).is(x2);
}
@Test
- public void bb01_asArray() throws Exception {
+ public void bb01_asArray() {
Integer[] x1 = {1,2}, nil = null;
String x2 = "";
test(x1).asArray(Integer.class).asItem(0).is(1);
@@ -127,7 +127,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb02_asIntArray() throws Exception {
+ public void bb02_asIntArray() {
int[] x1 = {1}, nil = null;
Object x2 = "";
test(x1).asIntArray().isString("[1]");
@@ -136,7 +136,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb03_asLongArray() throws Exception {
+ public void bb03_asLongArray() {
long[] x1 = {1}, nil = null;
Object x2 = "";
test(x1).asLongArray().isString("[1]");
@@ -145,7 +145,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb04_asShortArray() throws Exception {
+ public void bb04_asShortArray() {
short[] x1 = {1}, nil = null;
Object x2 = "";
test(x1).asShortArray().isString("[1]");
@@ -154,7 +154,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb05_asFloatArray() throws Exception {
+ public void bb05_asFloatArray() {
float[] x1 = {1}, nil = null;
Object x2 = "";
test(x1).asFloatArray().isString("[1.0]");
@@ -163,7 +163,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb06_asDoubleArray() throws Exception {
+ public void bb06_asDoubleArray() {
double[] x1 = {1}, nil = null;
Object x2 = "";
test(x1).asDoubleArray().isString("[1.0]");
@@ -172,7 +172,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb07_asCharArray() throws Exception {
+ public void bb07_asCharArray() {
char[] x1 = {'a'}, nil = null;
Object x2 = "";
test(x1).asCharArray().isString("[a]");
@@ -181,7 +181,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb08_asByteArray() throws Exception {
+ public void bb08_asByteArray() {
byte[] x1 = {1}, nil = null;
Object x2 = "";
test(x1).asByteArray().isString("[1]");
@@ -190,7 +190,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb09_asBooleanArray() throws Exception {
+ public void bb09_asBooleanArray() {
boolean[] x1 = {true}, nil = null;
Object x2 = "";
test(x1).asBooleanArray().isString("[true]");
@@ -199,7 +199,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb10_asBoolean() throws Exception {
+ public void bb10_asBoolean() {
Boolean x1 = true, nil = null;
Object x2 = "";
test(x1).asBoolean().isString("true");
@@ -208,7 +208,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb11_asBytes() throws Exception {
+ public void bb11_asBytes() {
byte[] x1 = {'a'}, nil = null;
Object x2 = "";
test(x1).asBytes().isString("a");
@@ -217,7 +217,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb12_asCollection() throws Exception {
+ public void bb12_asCollection() {
List<Integer> x1 = alist(1), nil = null;
Object x2 = "";
test(x1).asCollection().isString("[1]");
@@ -226,7 +226,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb13_asCollection_wType() throws Exception {
+ public void bb13_asCollection_wType() {
List<Integer> x1 = alist(1), nil = null;
Object x2 = "";
test(x1).asCollection(Integer.class).isString("[1]");
@@ -236,7 +236,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb14_asComparable() throws Exception {
+ public void bb14_asComparable() {
Integer x1 = 1, nil = null;
Object x2 = list();
test(x1).asComparable().isString("1");
@@ -245,7 +245,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb15_asDate() throws Exception {
+ public void bb15_asDate() {
Date x1 = date("2000-06-01T12:34:56Z"), nil = null;
Object x2 = "";
test(x1).asDate().asString().isMatches("*2000");
@@ -254,7 +254,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb16_asInteger() throws Exception {
+ public void bb16_asInteger() {
Integer x1 = 1, nil = null;
Object x2 = "";
test(x1).asInteger().isString("1");
@@ -263,7 +263,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb17_asLong() throws Exception {
+ public void bb17_asLong() {
Long x1 = 1L, nil = null;
Object x2 = "";
test(x1).asLong().isString("1");
@@ -272,7 +272,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb18_asList() throws Exception {
+ public void bb18_asList() {
List<Integer> x1 = alist(1), nil = null;
Object x2 = "";
test(x1).asList().isString("[1]");
@@ -281,7 +281,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb19_asList_wType() throws Exception {
+ public void bb19_asList_wType() {
List<Integer> x1 = alist(1), nil = null;
Object x2 = "";
test(x1).asList(Integer.class).isString("[1]");
@@ -291,7 +291,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb20_asMap() throws Exception {
+ public void bb20_asMap() {
Map<String,Integer> x1 = map("a",2), nil = null;
Object x2 = "";
test(x1).asMap().isString("{a=2}");
@@ -300,7 +300,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb21_asMap_wTypes() throws Exception {
+ public void bb21_asMap_wTypes() {
Map<String,Integer> x1 = map("a",2), nil = null;
Object x2 = "";
test(x1).asMap(String.class,Integer.class).isString("{a=2}");
@@ -311,14 +311,14 @@ public class AnyAssertion_Test {
}
@Test
- public void bb22_asBean() throws Exception {
+ public void bb22_asBean() {
A1 x1 = A1, nil = null;
test(x1).asBean().isString("a=1,b=2");
test(nil).asBean().isNull();
}
@Test
- public void bb23_asBean_wType() throws Exception {
+ public void bb23_asBean_wType() {
A1 x1 = A1, nil = null;
Object x2 = "";
test(x1).asBean().isString("a=1,b=2");
@@ -328,7 +328,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb24_asBeanList() throws Exception {
+ public void bb24_asBeanList() {
List<A1> x1 = alist(A1), nil = null;
Object x2 = "";
test(x1).asBeanList(A1.class).isString("[a=1,b=2]");
@@ -347,7 +347,7 @@ public class AnyAssertion_Test {
}
@Test
- public void bb26_asStringList() throws Exception {
+ public void bb26_asStringList() {
List<String> x1 = alist("1"), nil = null;
Object x2 = "";
test(x1).asStringList().isString("[1]");
@@ -360,28 +360,28 @@ public class AnyAssertion_Test {
//-----------------------------------------------------------------------------------------------------------------
@Test
- public void ca01_exists() throws Exception {
+ public void ca01_exists() {
Integer x = 1, nil = null;
test(x).isExists().isExists();
assertThrown(()->test(nil).isExists()).asMessage().is("Value
was null.");
}
@Test
- public void ca02_isNull() throws Exception {
+ public void ca02_isNull() {
Integer x = 1, nil = null;
test(nil).isNull();
assertThrown(()->test(x).isNull()).asMessage().is("Value was
not null.");
}
@Test
- public void ca03_isNotNull() throws Exception {
+ public void ca03_isNotNull() {
Integer x = 1, nil = null;
test(x).isNotNull();
assertThrown(()->test(nil).isNotNull()).asMessage().is("Value
was null.");
}
@Test
- public void ca04a_is_T() throws Exception {
+ public void ca04a_is_T() {
Integer x1 = 1, x1a = 1, x2 = 2, nil = null;
test(x1).is(x1);
test(x1).is(x1a);
@@ -392,7 +392,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca04b_is_predicate() throws Exception {
+ public void ca04b_is_predicate() {
Integer x1 = 1;
test(x1).is(x->x==1);
assertThrown(()->test(x1).is(x->x==2)).asMessage().asOneLine().is("Unexpected
value: '1'.");
@@ -400,7 +400,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca05_isNot() throws Exception {
+ public void ca05_isNot() {
Integer x1 = 1, x1a = 1, x2 = 2, nil = null;
test(x1).isNot(x2);
test(x1).isNot(nil);
@@ -410,7 +410,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca06_isAny() throws Exception {
+ public void ca06_isAny() {
Integer x1 = 1, x1a = 1, x2 = 2, nil = null;
test(x1).isAny(x1a, x2);
assertThrown(()->test(x1).isAny(x2)).asMessage().asOneLine().is("Expected value
not found. Expect='[2]'. Actual='1'.");
@@ -419,7 +419,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca07_isNotAny() throws Exception {
+ public void ca07_isNotAny() {
Integer x1 = 1, x1a = 1, x2 = 2, nil = null;
test(x1).isNotAny(x2);
test(x1).isNotAny();
@@ -429,7 +429,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca08_isSame() throws Exception {
+ public void ca08_isSame() {
Integer x1 = new Integer(1), x1a = new Integer(1), nil = null;
test(x1).isSame(x1);
test(nil).isSame(nil);
@@ -439,7 +439,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca09_isSameJsonAs() throws Exception {
+ public void ca09_isSameJsonAs() {
Integer x1 = 1, x1a = 1, x2 = 2, nil = null;
test(x1).isSameJsonAs(x1a);
test(nil).isSameJsonAs(nil);
@@ -449,7 +449,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca10_isSameSortedJsonAs() throws Exception {
+ public void ca10_isSameSortedJsonAs() {
Integer x1 = 1, x1a = 1, x2 = 2, nil = null;
test(x1).isSameSortedJsonAs(x1a);
test(nil).isSameSortedJsonAs(nil);
@@ -459,7 +459,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca11_isSameSerializedAs() throws Exception {
+ public void ca11_isSameSerializedAs() {
Integer x1 = 1, x1a = 1, x2 = 2, nil = null;
WriterSerializer s = Json5Serializer.DEFAULT;
test(x1).isSameSerializedAs(x1a, s);
@@ -470,7 +470,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca12_isType() throws Exception {
+ public void ca12_isType() {
Integer x = 1, nil = null;
test(x).isType(Integer.class);
test(x).isType(Object.class);
@@ -480,7 +480,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca13_isExactType() throws Exception {
+ public void ca13_isExactType() {
Integer x = 1, nil = null;
test(x).isExactType(Integer.class);
assertThrown(()->test(x).isExactType(Object.class)).asMessage().asOneLine().is("Unexpected
type. Expect='java.lang.Object'. Actual='java.lang.Integer'.");
@@ -490,7 +490,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca14_isString() throws Exception {
+ public void ca14_isString() {
Integer x = 1, nil = null;
test(x).isString("1");
test(nil).isString(null);
@@ -500,7 +500,7 @@ public class AnyAssertion_Test {
}
@Test
- public void ca15_isJson() throws Exception {
+ public void ca15_isJson() {
Integer x = 1, nil = null;
test(x).isJson("1");
test(nil).isJson("null");
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/config/ConfigMapListenerTest.java
b/juneau-utest/src/test/java/org/apache/juneau/config/ConfigMapListenerTest.java
index 659f74f25..edb76d8cd 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/config/ConfigMapListenerTest.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/config/ConfigMapListenerTest.java
@@ -584,8 +584,7 @@ public class ConfigMapListenerTest {
latch.countDown();
}
- public void check(ConfigEvents events) throws Exception {
- }
+ public void check(ConfigEvents events) throws Exception {} //
NOSONAR
}
private static void wait(CountDownLatch latch) throws
InterruptedException {
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/cp/BeanStore_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/cp/BeanStore_Test.java
index 43bbd1ed7..6a33e71cb 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/cp/BeanStore_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/cp/BeanStore_Test.java
@@ -1041,8 +1041,8 @@ public class BeanStore_Test {
public String b;
}
protected D17(Builder b, Integer i) { a = b.b; }
- protected D17(Integer i) {}
- D17(String s) {}
+ protected D17(Integer i) {} // NOSONAR
+ D17(String s) {} // NOSONAR
protected D17(Builder b) { a = b.b; }
}
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtils_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtils_Test.java
index 6c65cb666..477b7eb1b 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtils_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtils_Test.java
@@ -57,7 +57,7 @@ public class AnnotationUtils_Test {
}
@Test
- public void a01_Body() throws Exception {
+ public void a01_Body() {
assertObject(body().build().annotationType()).asJson().isContains("Content");
assertTrue(ContentAnnotation.empty(A1.class.getAnnotation(Content.class)));
@@ -67,7 +67,7 @@ public class AnnotationUtils_Test {
}
@Test
- public void a02_Contact() throws Exception {
+ public void a02_Contact() {
X1 x1 = A1.class.getAnnotation(X1.class);
assertObject(contact().build().annotationType()).asJson().isContains("Contact");
@@ -100,7 +100,7 @@ public class AnnotationUtils_Test {
}
@Test
- public void a04_HasFormData() throws Exception {
+ public void a04_HasFormData() {
assertObject(hasFormData().build().annotationType()).asJson().isContains("HasFormData");
assertObject(hasFormData().name("foo").build().name()).asJson().is("'foo'");
@@ -126,7 +126,7 @@ public class AnnotationUtils_Test {
}
@Test
- public void a06_HasQuery() throws Exception {
+ public void a06_HasQuery() {
assertObject(hasQuery().build().annotationType()).asJson().isContains("HasQuery");
assertObject(hasQuery().name("foo").build().name()).asJson().is("'foo'");
@@ -152,7 +152,7 @@ public class AnnotationUtils_Test {
}
@Test
- public void a08_License() throws Exception {
+ public void a08_License() {
X1 x = A1.class.getAnnotation(X1.class);
assertObject(license().build().annotationType()).asJson().isContains("License");
@@ -184,7 +184,7 @@ public class AnnotationUtils_Test {
}
@Test
- public void a10_Request() throws Exception {
+ public void a10_Request() {
assertObject(request().build().annotationType()).asJson().isContains("Request");
assertObject(request().parser(OpenApiParser.class).build().parser()).asJson().is("'org.apache.juneau.oapi.OpenApiParser'");
@@ -192,7 +192,7 @@ public class AnnotationUtils_Test {
}
@Test
- public void a11_Response() throws Exception {
+ public void a11_Response() {
assertObject(response().build().annotationType()).asJson().isContains("Response");
assertTrue(ResponseAnnotation.empty(A1.class.getAnnotation(Response.class)));
@@ -208,12 +208,12 @@ public class AnnotationUtils_Test {
}
@Test
- public void a14_ResponseStatus() throws Exception {
+ public void a14_ResponseStatus() {
assertObject(responseCode().build().annotationType()).asJson().isContains("StatusCode");
}
@Test
- public void a15_Tag() throws Exception {
+ public void a15_Tag() {
assertObject(tag().build().annotationType()).asJson().isContains("Tag");
assertObject(tag().description(a("foo")).build().description()).asJson().is("['foo']");
@@ -222,7 +222,7 @@ public class AnnotationUtils_Test {
}
@Test
- public void a16_ExternalDocs() throws Exception {
+ public void a16_ExternalDocs() {
X1 x = A1.class.getAnnotation(X1.class);
assertObject(externalDocs().build().annotationType()).asJson().isContains("ExternalDocs");
@@ -235,7 +235,7 @@ public class AnnotationUtils_Test {
}
@Test
- public void a17_Schema() throws Exception {
+ public void a17_Schema() {
X1 x = A1.class.getAnnotation(X1.class);
assertObject(schema().build().annotationType()).asJson().isContains("Schema");
@@ -298,7 +298,7 @@ public class AnnotationUtils_Test {
}
@Test
- public void a18_SubItems() throws Exception {
+ public void a18_SubItems() {
X1 x = A1.class.getAnnotation(X1.class);
assertObject(subItems().build().annotationType()).asJson().isContains("SubItems");
@@ -343,7 +343,7 @@ public class AnnotationUtils_Test {
}
@Test
- public void a19_Items() throws Exception {
+ public void a19_Items() {
X1 x = A1.class.getAnnotation(X1.class);
assertObject(items().build().annotationType()).asJson().isContains("Items");
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/header/Accept_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/header/Accept_Test.java
index e38af1f38..fdb5ab9a0 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/http/header/Accept_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/http/header/Accept_Test.java
@@ -69,7 +69,7 @@ public class Accept_Test {
}
@Test
- public void a02_asRanges() throws Exception {
+ public void a02_asRanges() {
assertObject(new
Accept((String)null).asMediaRanges().orElse(null)).isNull();
assertInteger(new
Accept((String)null).match(alist(MediaType.JSON))).is(-1);
assertObject(new Accept((String)null).getRange(0)).isNull();
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/reflect/MethodInfoTest.java
b/juneau-utest/src/test/java/org/apache/juneau/reflect/MethodInfoTest.java
index 9ba935aee..9d5ac15db 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/reflect/MethodInfoTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/reflect/MethodInfoTest.java
@@ -303,7 +303,7 @@ public class MethodInfoTest {
//-----------------------------------------------------------------------------------------------------------------
public static class D {
- public void a1() {}
+ public void a1() {} // NOSONAR
public Integer a2() {return null;}
}
static MethodInfo
@@ -341,8 +341,8 @@ public class MethodInfoTest {
public void a1(CharSequence foo) {
f = foo == null ? null : foo.toString();
}
- public void a2(int f1, int f2) {}
- public void a3() {}
+ public void a2(int f1, int f2) {} // NOSONAR
+ public void a3() {} // NOSONAR
}
static MethodInfo
e_a1 = ofm(E.class, "a1", CharSequence.class), // NOSONAR
@@ -382,13 +382,13 @@ public class MethodInfoTest {
}
public static class F {
- public void isA() {}
- public void is() {}
- public void getA() {}
- public void get() {}
- public void setA() {}
- public void set() {}
- public void foo() {}
+ public void isA() {} // NOSONAR
+ public void is() {} // NOSONAR
+ public void getA() {} // NOSONAR
+ public void get() {} // NOSONAR
+ public void setA() {} // NOSONAR
+ public void set() {} // NOSONAR
+ public void foo() {} // NOSONAR
}
static MethodInfo
f_isA = ofm(F.class, "isA"), // NOSONAR
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/reflect/ParamInfoTest.java
b/juneau-utest/src/test/java/org/apache/juneau/reflect/ParamInfoTest.java
index 4fa3bd266..a2d01ca48 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/reflect/ParamInfoTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/reflect/ParamInfoTest.java
@@ -80,8 +80,8 @@ public class ParamInfoTest {
static class B {
public B(int a, String b) {}
- public void a1(int a, String b) {}
- void a2(int a, String b) {}
+ public void a1(int a, String b) {} // NOSONAR
+ void a2(int a, String b) {} // NOSONAR
}
static ClassInfo b = ClassInfo.of(B.class);
@@ -319,7 +319,7 @@ public class ParamInfoTest {
}
public static class DC implements DB {
@Override
- public void a1(@DA("5") D1 x) {}
+ public void a1(@DA("5") D1 x) {} // NOSONAR
}
static ClassInfo
@@ -356,7 +356,7 @@ public class ParamInfoTest {
//-----------------------------------------------------------------------------------------------------------------
static class E {
- public void a1(int a, @Name("b") int b) {}
+ public void a1(int a, @Name("b") int b) {} // NOSONAR
}
static ClassInfo e = ClassInfo.of(E.class);
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_RestClient_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_RestClient_Test.java
index df7dc9a0c..0bca2547d 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_RestClient_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_RestClient_Test.java
@@ -23,7 +23,6 @@ import java.io.*;
import java.util.concurrent.*;
import java.util.logging.*;
import org.apache.http.*;
-import org.apache.http.client.*;
import org.apache.http.impl.client.*;
import org.apache.http.protocol.*;
import org.apache.juneau.*;
@@ -93,7 +92,7 @@ public class RestClient_Config_RestClient_Test {
super(client);
}
@Override
- public HttpResponse run(HttpHost target, HttpRequest request,
HttpContext context) throws ClientProtocolException, IOException {
+ public HttpResponse run(HttpHost target, HttpRequest request,
HttpContext context) throws IOException {
request.addHeader("Check","Foo");
request.addHeader("Foo","baz");
return super.run(target,request,context);
@@ -106,7 +105,7 @@ public class RestClient_Config_RestClient_Test {
}
@Test
- public void a02_errorCodes() throws Exception {
+ public void a02_errorCodes() {
RestClient x1 = client().errorCodes(x -> x == 200).build();
RestClient x2 = client().build();
assertThrown(()->x1.get("/echo").run()).is(x ->
((RestCallException)x).getResponseCode() == 200);
@@ -307,7 +306,7 @@ public class RestClient_Config_RestClient_Test {
}
@Test
- public void a06_interceptors_exceptionHandling() throws Exception {
+ public void a06_interceptors_exceptionHandling() {
assertThrown(()->client().interceptors(A6a.class).build().post("/bean",bean).complete()).asMessage().is("foo");
assertThrown(()->client().interceptors(A6b.class).build().post("/bean",bean).complete()).asMessage().is("foo");
assertThrown(()->client().interceptors(A6c.class).build().post("/bean",bean).complete()).asMessage().is("foo");
@@ -459,7 +458,7 @@ public class RestClient_Config_RestClient_Test {
@Test
- public void a13_toString() throws Exception {
+ public void a13_toString() {
String s = client().rootUrl("https://foo").build().toString();
assertTrue(s.contains("rootUrl: 'https://foo'"));
}
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Body_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Body_Test.java
index 2ab747f22..dac5f6ff9 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Body_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Body_Test.java
@@ -64,8 +64,7 @@ public class RestClient_Response_Body_Test {
return bean;
}
@RestOp
- public void head() {
- }
+ public void head() {} // NOSONAR
}
public static class TestClient extends MockRestClient {
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Test.java
index f6cee58ad..b41827415 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Test.java
@@ -24,7 +24,6 @@ import java.util.concurrent.atomic.*;
import org.apache.http.*;
import org.apache.http.auth.*;
-import org.apache.http.client.*;
import org.apache.http.client.config.*;
import org.apache.http.client.methods.*;
import org.apache.http.concurrent.*;
@@ -71,8 +70,7 @@ public class RestClient_Test {
//------------------------------------------------------------------------------------------------------------------
public static class A2 extends RestClient.Builder {
- public A2() {
- }
+ public A2() {} // NOSONAR
}
@Test
diff --git a/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXmlTest.java
b/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXmlTest.java
index 84a153242..9af4ce282 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXmlTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXmlTest.java
@@ -1099,7 +1099,7 @@ public class BasicXmlTest {
private String label, e1, e2, e3;
private Object in;
- public BasicXmlTest(String label, Object in, String e1, String e2,
String e3) throws Exception {
+ public BasicXmlTest(String label, Object in, String e1, String e2,
String e3) {
this.label = label;
this.in = in;
this.e1 = e1;