@Test public void testInvalidProtobufFdContent() { ContentHandle content = ContentHandle.create("qwerty"); ProtobufFdContentValidator validator = new ProtobufFdContentValidator(); Assertions.assertThrows(InvalidContentException.class, () -> { validator.validate(ValidityLevel.FULL, content); }); }
@Override public void validate(ValidityLevel level, ContentHandle artifactContent) throws InvalidContentException { if (level == ValidityLevel.FULL) { try { Serde.Schema.parseFrom(artifactContent.bytes()); } catch (Exception e) { throw new InvalidContentException("Content violation for ProtobufFD artifact.", e); } } }
ProtobufFdContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle artifactContent) throws InvalidContentException { if (level == ValidityLevel.FULL) { try { Serde.Schema.parseFrom(artifactContent.bytes()); } catch (Exception e) { throw new InvalidContentException("Content violation for ProtobufFD artifact.", e); } } } }
ProtobufFdContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle artifactContent) throws InvalidContentException { if (level == ValidityLevel.FULL) { try { Serde.Schema.parseFrom(artifactContent.bytes()); } catch (Exception e) { throw new InvalidContentException("Content violation for ProtobufFD artifact.", e); } } } ProtobufFdContentValidator(); }
ProtobufFdContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle artifactContent) throws InvalidContentException { if (level == ValidityLevel.FULL) { try { Serde.Schema.parseFrom(artifactContent.bytes()); } catch (Exception e) { throw new InvalidContentException("Content violation for ProtobufFD artifact.", e); } } } ProtobufFdContentValidator(); @Override void validate(ValidityLevel level, ContentHandle artifactContent); }
ProtobufFdContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle artifactContent) throws InvalidContentException { if (level == ValidityLevel.FULL) { try { Serde.Schema.parseFrom(artifactContent.bytes()); } catch (Exception e) { throw new InvalidContentException("Content violation for ProtobufFD artifact.", e); } } } ProtobufFdContentValidator(); @Override void validate(ValidityLevel level, ContentHandle artifactContent);  }