Skip to content

spring-boot-starter-test conflicts with json library #8706

Closed
@syakovyn

Description

@syakovyn

Hi,

org.springframework.boot:spring-boot-starter-test -> 1.5.2.RELEASE has an indirect dependency on com.vaadin.external.google:android-json:0.0.20131108.vaadin1 via org.skyscreamer:jsonassert:1.4.0.

The reference documentation mentions both org.skyscreamer:jsonassert:1.4.0 and org.json:json:20140107. As far as I understand, they should be compatible. However, com.vaadin.external.google:android-json:0.0.20131108.vaadin1 conflicts with org.json:json:20140107 as it represents the re-implementation of some older version of org.json:json.

In particular, org.json.JSONTokener#JSONTokener(java.io.Reader) exists only in org.json:json:20140107 and is absent in com.vaadin.external.google:android-json:0.0.20131108.vaadin1, causing my tests to fail with java.lang.NoSuchMethodError: org.json.JSONTokener.<init>(Ljava/io/Reader;)V exceptions.

The solution to my issue is not to use spring-boot-starter-test, but instead use spring-boot-test, spring-boot-test-autoconfigure and spring-test directly and add all other dependencies as needed.

In a case, that org.skyscreamer:jsonassert:1.4.0 is required, exclude com.vaadin.external.google:android-json:0.0.20131108.vaadin1.

If looking for the JSON assertions library consider net.javacrumbs.json-unit:json-unit-fluent that has similar to AssertJ fluent API.

Thanks,
Serhiy

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions