5050import org .junit .jupiter .api .Assumptions ;
5151import org .junit .jupiter .api .BeforeEach ;
5252import org .junit .jupiter .api .Test ;
53+ import org .mockito .ArgumentMatchers ;
5354import org .mockito .Mockito ;
5455import org .mockito .stubbing .Answer ;
5556
6162 * @checkstyle AbbreviationAsWordInNameCheck (5 lines)
6263 */
6364@ SuppressWarnings ({ "PMD.TooManyMethods" , "PMD.AvoidDuplicateLiterals" })
64- public final class StrictXMLTest {
65+ final class StrictXMLTest {
6566
6667 @ BeforeEach
67- public void weAreOnline () throws IOException {
68+ void weAreOnline () throws IOException {
6869 Assumptions .assumeTrue (
6970 InetAddress .getByName ("w3.org" ).isReachable (1000 )
7071 );
7172 }
7273
7374 @ Test
74- public void passesValidXmlThrough () {
75+ void passesValidXmlThrough () {
7576 new StrictXML (
7677 new XMLDocument ("<root>passesValidXmlThrough</root>" ),
7778 new XSDDocument (
@@ -85,7 +86,7 @@ public void passesValidXmlThrough() {
8586 }
8687
8788 @ Test
88- public void rejectsInvalidXmlThrough () {
89+ void rejectsInvalidXmlThrough () {
8990 Assertions .assertThrows (
9091 IllegalArgumentException .class ,
9192 () -> new StrictXML (
@@ -101,7 +102,7 @@ public void rejectsInvalidXmlThrough() {
101102 }
102103
103104 @ Test
104- public void passesValidXmlUsingXsiSchemaLocation () throws Exception {
105+ void passesValidXmlUsingXsiSchemaLocation () throws Exception {
105106 new StrictXML (
106107 new XMLDocument (
107108 this .getClass ().getResource ("xsi-schemalocation-valid.xml" )
@@ -110,7 +111,7 @@ public void passesValidXmlUsingXsiSchemaLocation() throws Exception {
110111 }
111112
112113 @ Test
113- public void rejectsInvalidXmlUsingXsiSchemaLocation () {
114+ void rejectsInvalidXmlUsingXsiSchemaLocation () {
114115 Assertions .assertThrows (
115116 IllegalStateException .class ,
116117 () -> new StrictXML (
@@ -122,7 +123,7 @@ public void rejectsInvalidXmlUsingXsiSchemaLocation() {
122123 }
123124
124125 @ Test
125- public void validatesMultipleXmlsInThreads () throws Exception {
126+ void validatesMultipleXmlsInThreads () throws Exception {
126127 final int timeout = 10 ;
127128 final int numrun = 100 ;
128129 final int loop = 50 ;
@@ -176,7 +177,7 @@ public void validatesMultipleXmlsInThreads() throws Exception {
176177 }
177178
178179 @ Test
179- public void passesValidXmlWithNetworkProblems () throws Exception {
180+ void passesValidXmlWithNetworkProblems () throws Exception {
180181 final Validator validator = Mockito .mock (Validator .class );
181182 final AtomicInteger counter = new AtomicInteger (0 );
182183 // @checkstyle IllegalThrowsCheck (5 lines)
@@ -190,7 +191,7 @@ public void passesValidXmlWithNetworkProblems() throws Exception {
190191 }
191192 return null ;
192193 }
193- ).when (validator ).validate (Mockito .any (Source .class ));
194+ ).when (validator ).validate (ArgumentMatchers .any (Source .class ));
194195 new StrictXML (
195196 new XMLDocument (
196197 "<root>passesValidXmlWithNetworkProblems</root>"
@@ -200,7 +201,7 @@ public void passesValidXmlWithNetworkProblems() throws Exception {
200201 }
201202
202203 @ Test
203- public void lookupXsdsFromClasspath () {
204+ void lookupXsdsFromClasspath () {
204205 new StrictXML (
205206 new XMLDocument (
206207 StringUtils .join (
@@ -224,7 +225,7 @@ public void lookupXsdsFromClasspath() {
224225 }
225226
226227 @ Test
227- public void rejectXmlWhenXsdIsNotAvailableOnClasspath () {
228+ void rejectXmlWhenXsdIsNotAvailableOnClasspath () {
228229 Assertions .assertThrows (
229230 IllegalArgumentException .class ,
230231 () -> new StrictXML (
@@ -251,7 +252,7 @@ public void rejectXmlWhenXsdIsNotAvailableOnClasspath() {
251252 }
252253
253254 @ Test
254- public void handlesXmlWithoutSchemaLocation () {
255+ void handlesXmlWithoutSchemaLocation () {
255256 Assertions .assertThrows (
256257 IllegalArgumentException .class ,
257258 () -> new StrictXML (
0 commit comments