The "spring-boot-starter-test:3.1.5" there is a dependency on the library "jsonassert:1.5.1" which in turn has a dependency on the library "android-json:0.0.20131108.vaadin1".
The latter contains its own implementation of the "json" library from the group "org.json" (https://mvnrepository.com/artifact/org.json/json).
This implementation is incomplete and incompatible with the API declared in the original library, namely the org.json.JSONArray class does not have the "isEmpty" method.
This leads to the addition of the "spring-boot-starter-test" dependency:3.1.5" to a project that already uses the library "json:20220924" leads to the replacement of the original library with an implementation from "android-json:0.0.20131108.vaadin1".
And as a result, your application will crash in runtime with the error "java.lang.NoSuchMethodError 'boolean org.json.JSONArray.isEmpty()"if you use this method anywhere in your code.
Of course, you can solve the problem by excluding this library from the package "spring-boot-starter-test" for example, using the
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
but nevertheless, I think it's worth solving this problem in another way - not to supply the "spring-boot-starter-test" library package with this "android-json" dependency.:0.0.20131108.vaadin1".
Comment From: wilkinsona
Duplicates https://github.com/spring-projects/spring-boot/issues/9248.
I'm afraid that nothing's changed since #9248 and there's nothing that we can do about this due to the licensing of org.json:json. While the licence was changed in 2022, it now simply states that it is "Public Domain". This is not a recognised open source licence so, unfortunately, we and many other projects in the Java ecosystem do not feel that they can safely depend upon it.
Comment From: Nphox
Eh, but thanks for your answer anyway