use of io.dekorate.DekorateException in project dekorate by dekorateio.
the class SerializationTest method shouldProduceMeaningFullErrorForSingleResource.
@Test
public void shouldProduceMeaningFullErrorForSingleResource() throws Exception {
try (InputStream is = getClass().getClassLoader().getResourceAsStream("single-resource-with-errors.yml")) {
KubernetesList list = Serialization.unmarshalAsList(is);
fail();
} catch (DekorateException e) {
if (e.getCause() instanceof JsonProcessingException) {
JsonProcessingException jpe = (JsonProcessingException) e.getCause();
assertEquals(6, jpe.getLocation().getLineNr());
} else {
fail();
}
}
}
use of io.dekorate.DekorateException in project dekorate by dekorateio.
the class SerializationTest method shouldProduceMeaningFullErrorForMultipleResource.
@Test
public void shouldProduceMeaningFullErrorForMultipleResource() throws Exception {
try (InputStream is = getClass().getClassLoader().getResourceAsStream("multiple-resources-with-errors.yml")) {
KubernetesList list = Serialization.unmarshalAsList(is);
fail();
} catch (DekorateException e) {
if (e.getCause() instanceof JsonProcessingException) {
JsonProcessingException jpe = (JsonProcessingException) e.getCause();
assertEquals(19, jpe.getLocation().getLineNr());
} else {
fail();
}
}
}
Aggregations