@Test public void testValidProtobufFdContent() { TestCmmn.UUID uuid = TestCmmn.UUID.newBuilder() .setLsb(77) .setMsb(23) .build(); ContentHandle content = ContentHandle.create(toSchemaProto(uuid.getDescriptorForType().getFile()).toByteArray()); ProtobufFdContentValidator validator = new ProtobufFdContentValidator(); 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);  }