fix: factory resolver API
Signed-off-by: Oleksii Orel <oorel@redhat.com>pull/505/head
parent
d0402f0b8e
commit
14720a4d8d
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012-2021 Red Hat, Inc.
|
||||
* Copyright (c) 2012-2023 Red Hat, Inc.
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
|
|
@ -121,7 +121,6 @@ public class DevfileParser {
|
|||
* @return devfile in simple Map structure
|
||||
*/
|
||||
public Map<String, Object> convertYamlToMap(JsonNode devfileJson) throws DevfileFormatException {
|
||||
schemaValidator.validate(devfileJson);
|
||||
return yamlMapper.convertValue(devfileJson, new TypeReference<>() {});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import static org.testng.Assert.assertEquals;
|
|||
import static org.testng.Assert.assertNotNull;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
|
|
@ -199,14 +198,4 @@ public class DevfileParserTest {
|
|||
// when
|
||||
devfileParser.parseJson(DEVFILE_YAML_CONTENT);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldConvertYamlToMapAndValidate() throws Exception {
|
||||
// when
|
||||
devfileParser.convertYamlToMap(devfileJsonNode);
|
||||
|
||||
// then
|
||||
verify(schemaValidator).validate(eq(devfileJsonNode));
|
||||
verify(yamlMapper).convertValue(eq(devfileJsonNode), any(TypeReference.class));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue