MavenAttributesHelper { static void setMavenAttributes(final FluentComponent component, final Coordinates coordinates) { Map<String, String> mavenAttributes = new HashMap<>(); mavenAttributes.put(P_GROUP_ID, coordinates.getGroupId()); mavenAttributes.put(P_ARTIFACT_ID, coordinates.getArtifactId()); mavenAttributes.put(P_VERSION, coordinates.getVersion()); mavenAttributes.put(P_BASE_VERSION, coordinates.getBaseVersion()); component.withAttribute(NAME, mavenAttributes); } private  MavenAttributesHelper();   }
@Test public void shouldPutComponentAttributesInAMap() { MavenAttributesHelper.setMavenAttributes(fluentComponent, coordinates); verify(fluentComponent).withAttribute(eq(NAME), attributesValueCaptor.capture()); assertGroupArtifactVersionSet(4, attributesValueCaptor.getValue()); }
@Test public void shouldPutAssetAttributesInAMap() { when(mavenPath.getCoordinates()).thenReturn(coordinates); MavenAttributesHelper.setMavenAttributes(fluentAsset, mavenPath); verify(fluentAsset).withAttribute(eq(NAME), attributesValueCaptor.capture()); Map<String, String> map = attributesValueCaptor.getValue(); assertGroupArtifactVersionSet(6, map); assertThat(map, hasEntry(P_CLASSIFIER, coordinates.getClassifier())); assertThat(map, hasEntry(P_VERSION, coordinates.getVersion())); }