protected List<MavenArtifact> processResponse(Dependency dependency, HttpURLConnection conn) throws IOException {
        final List<MavenArtifact> result = new ArrayList<>();

        try (InputStreamReader streamReader = new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8);
                JsonParser parser = objectReader.getFactory().createParser(streamReader)) {

            if (init(parser) && parser.nextToken() == com.fasterxml.jackson.core.JsonToken.START_OBJECT) {
                // at least one result
                do {
                    final FileImpl file = objectReader.readValue(parser);

                    checkHashes(dependency, file.getChecksums());

                    final Matcher pathMatcher = PATH_PATTERN.matcher(file.getPath());
                    if (!pathMatcher.matches()) {
                        throw new IllegalStateException("Cannot extract the Maven information from the path "
                                + "retrieved in Artifactory " + file.getPath());
                    }

                    final String groupId = pathMatcher.group("groupId").replace('/', '.');
                    final String artifactId = pathMatcher.group("artifactId");
                    final String version = pathMatcher.group("version");

                    result.add(new MavenArtifact(groupId, artifactId, version, file.getDownloadUri(),
                            MavenArtifact.derivePomUrl(artifactId, version, file.getDownloadUri())));

                } while (parser.nextToken() == com.fasterxml.jackson.core.JsonToken.START_OBJECT);
            } else {
                throw new FileNotFoundException("Artifact " + dependency + " not found in Artifactory");
            }
        }

        return result;
    }
@Test
    public void shouldProcessCorrectlyArtifactoryAnswerWithoutSha256() throws IOException {
        // Given
        Dependency dependency = new Dependency();
        dependency.setSha1sum("2e66da15851f9f5b5079228f856c2f090ba98c38");
        dependency.setMd5sum("3dbee72667f107b4f76f2d5aa33c5687");
        final HttpURLConnection urlConnection = mock(HttpURLConnection.class);
        final byte[] payload = ("{\n" +
                "  \"results\" : [ {\n" +
                "    \"repo\" : \"jcenter-cache\",\n" +
                "    \"path\" : \"/com/google/code/gson/gson/2.1/gson-2.1.jar\",\n" +
                "    \"created\" : \"2017-06-14T16:15:37.936+02:00\",\n" +
                "    \"createdBy\" : \"anonymous\",\n" +
                "    \"lastModified\" : \"2012-12-12T22:20:22.000+01:00\",\n" +
                "    \"modifiedBy\" : \"anonymous\",\n" +
                "    \"lastUpdated\" : \"2017-06-14T16:15:37.939+02:00\",\n" +
                "    \"properties\" : {\n" +
                "      \"artifactory.internal.etag\" : [ \"2e66da15851f9f5b5079228f856c2f090ba98c38\" ]\n" +
                "    },\n" +
                "    \"downloadUri\" : \"https://artifactory.techno.ingenico.com/artifactory/jcenter-cache/com/google/code/gson/gson/2.1/gson-2.1.jar\",\n" +
                "    \"remoteUrl\" : \"http://jcenter.bintray.com/com/google/code/gson/gson/2.1/gson-2.1.jar\",\n" +
                "    \"mimeType\" : \"application/java-archive\",\n" +
                "    \"size\" : \"180110\",\n" +
                "    \"checksums\" : {\n" +
                "      \"sha1\" : \"2e66da15851f9f5b5079228f856c2f090ba98c38\",\n" +
                "      \"md5\" : \"3dbee72667f107b4f76f2d5aa33c5687\"\n" +
                "    },\n" +
                "    \"originalChecksums\" : {\n" +
                "      \"sha1\" : \"2e66da15851f9f5b5079228f856c2f090ba98c38\"\n" +
                "    },\n" +
                "    \"uri\" : \"https://artifactory.techno.ingenico.com/artifactory/api/storage/jcenter-cache/com/google/code/gson/gson/2.1/gson-2.1.jar\"\n" +
                "  } ]\n" +
                "}").getBytes(StandardCharsets.UTF_8);
        when(urlConnection.getInputStream()).thenReturn(new ByteArrayInputStream(payload));

        // When
        final List<MavenArtifact> mavenArtifacts = searcher.processResponse(dependency, urlConnection);

        // Then

        assertEquals(1, mavenArtifacts.size());
        final MavenArtifact artifact = mavenArtifacts.get(0);
        assertEquals("com.google.code.gson", artifact.getGroupId());
        assertEquals("gson", artifact.getArtifactId());
        assertEquals("2.1", artifact.getVersion());
        assertEquals("https://artifactory.techno.ingenico.com/artifactory/jcenter-cache/com/google/code/gson/gson/2.1/gson-2.1.jar", artifact.getArtifactUrl());
        assertEquals("https://artifactory.techno.ingenico.com/artifactory/jcenter-cache/com/google/code/gson/gson/2.1/gson-2.1.pom", artifact.getPomUrl());
    }