@Test
public void fromValidConfigMap() {

    Map<String, String> params = new HashMap<>();
    CloudImageParameters imageParameters = new CloudImageParameters();
    imageParameters.setParameter(CloudImageParameters.SOURCE_ID_FIELD, "TestProfile");
    imageParameters.setParameter(CloudImageParameters.AGENT_POOL_ID_FIELD, "42");
    Collection<CloudImageParameters> cloudImageParameters = Collections.singleton(imageParameters);
    params.put(CloudImageParameters.SOURCE_IMAGES_JSON,
            CloudImageParameters.collectionToJson(cloudImageParameters));
    DockerImageConfig imageConfig = DockerImageConfigBuilder.
            newBuilder("TestProfile", Node.EMPTY_OBJECT).
            build();
    TestDockerImageConfigParser imageParser = new TestDockerImageConfigParser();
    imageParser.addConfig(imageConfig);
    params.put(DockerCloudUtils.IMAGES_PARAM, imageParser.getImagesParams().toString());
    List<DockerImageConfig> images = DockerImageConfig.processParams(imageParser, params, cloudImageParameters);
    assertThat(images).containsExactly(imageConfig);
    List<Collection<CloudImageParameters>> imagesParametersList = imageParser.getImagesParametersList();
    assertThat(imagesParametersList).hasSize(1);
    assertThat(imagesParametersList.get(0)).isSameAs(cloudImageParameters);
}