MavenVariableResolverAdapterUtil { public static Map<String, String> createCoordinateMap(Coordinates coordinates) { Map<String, String> coordMap = new HashMap<>(); coordMap.put(GROUP_ID, coordinates.getGroupId()); coordMap.put(ARTIFACT_ID, coordinates.getArtifactId()); coordMap.put(VERSION, coordinates.getBaseVersion()); coordMap.put(EXTENSION, coordinates.getExtension()); coordMap.put(CLASSIFIER, coordinates.getClassifier() == null ? EMPTY : coordinates.getClassifier()); return coordMap; } private  MavenVariableResolverAdapterUtil(); static Map<String, String> createCoordinateMap(Coordinates coordinates);  }
@Test public void shouldCopyCoordinatesToMap() { Coordinates coordinates = new Coordinates(false, "org.mockito", "mockito-core", "3.24", 3600L, 100, "3.24", "test", ".jar", GPG); Map<String, String> map = createCoordinateMap(coordinates); assertThat(map, hasEntry("groupId", "org.mockito")); assertThat(map, hasEntry("artifactId", "mockito-core")); assertThat(map, hasEntry("version", "3.24")); assertThat(map, hasEntry("extension", ".jar")); assertThat(map, hasEntry("classifier", "test")); }
@Test public void classifierShouldBeEmptyStringWhenNotSet() { Coordinates coordinates = new Coordinates(false, "org.mockito", "mockito-core", "3.24", 3600L, 100, "3.24", null, ".jar", GPG); Map<String, String> map = createCoordinateMap(coordinates); assertThat(map, hasEntry("classifier", EMPTY)); }