@Test void shouldSerializeTaskIdentifiers() { String name = "task-a"; TaskIdentifier id = TaskIdentifier.builder() .domain(DOMAIN) .project(PROJECT) .name(name) .version(VERSION) .build(); IdentifierOuterClass.Identifier serializedId = ProtoUtil.serialize(id); assertThat( serializedId, equalTo( IdentifierOuterClass.Identifier.newBuilder() .setResourceType(TASK) .setDomain(DOMAIN) .setProject(PROJECT) .setName(name) .setVersion(VERSION) .build())); }
static IdentifierOuterClass.Identifier serialize(Identifier id) { IdentifierOuterClass.ResourceType type = getResourceType(id); return IdentifierOuterClass.Identifier.newBuilder() .setResourceType(type) .setDomain(id.domain()) .setProject(id.project()) .setName(id.name()) .setVersion(id.version()) .build(); }
ProtoUtil { static IdentifierOuterClass.Identifier serialize(Identifier id) { IdentifierOuterClass.ResourceType type = getResourceType(id); return IdentifierOuterClass.Identifier.newBuilder() .setResourceType(type) .setDomain(id.domain()) .setProject(id.project()) .setName(id.name()) .setVersion(id.version()) .build(); } }
ProtoUtil { static IdentifierOuterClass.Identifier serialize(Identifier id) { IdentifierOuterClass.ResourceType type = getResourceType(id); return IdentifierOuterClass.Identifier.newBuilder() .setResourceType(type) .setDomain(id.domain()) .setProject(id.project()) .setName(id.name()) .setVersion(id.version()) .build(); } private  ProtoUtil(); }
ProtoUtil { static IdentifierOuterClass.Identifier serialize(Identifier id) { IdentifierOuterClass.ResourceType type = getResourceType(id); return IdentifierOuterClass.Identifier.newBuilder() .setResourceType(type) .setDomain(id.domain()) .setProject(id.project()) .setName(id.name()) .setVersion(id.version()) .build(); } private  ProtoUtil(); static Workflow.WorkflowTemplate serialize(WorkflowTemplate template); }
ProtoUtil { static IdentifierOuterClass.Identifier serialize(Identifier id) { IdentifierOuterClass.ResourceType type = getResourceType(id); return IdentifierOuterClass.Identifier.newBuilder() .setResourceType(type) .setDomain(id.domain()) .setProject(id.project()) .setName(id.name()) .setVersion(id.version()) .build(); } private  ProtoUtil(); static Workflow.WorkflowTemplate serialize(WorkflowTemplate template);  }