An ActivityPub Test

Background

ActivityPub § 5.8 Shares Collection:

Every object MAY have a shares collection.… The shares collection MUST be either an OrderedCollection or a Collection

About this Test

This is a Test describing a rule to determine whether an ActivityPub object has a shares property whose value conforms to a the requirement that "The shares collection MUST be either an OrderedCollection or a Collection".

Identifier

The identifier of this test is urn:uuid:b03a5245-1072-426d-91b3-a3d412d45ae8.

Test Subject

The subject of this test is data claiming to conform to the specification of an ActivityPub Object.

This test is not inherently applicable to an ActivityPub Server. An ActivityPub Server serves 1 or more ActivityPub Objects.

This test is not inherently applicable to a URL that resolves to an ActivityPub Object. The URL is not the same as the Object. The URL may resolve to different Objects in different contexts. Dereference the URL to test the referent with this test.

Inputs

This test requires the following inputs:

  1. object - the object whose shares property will be tested

Applicability

This test applies to the the shares property on the input object.

This test does not apply to objects with more than one shares collection. If the input object has a shares property whose value is an array length >= 2, the test outcome is inapplicable.

This test does not apply to objects for which a shares collection cannot be found. If input object is not parseable as JSON to a JSON object, the test outcome is inapplicable. If input object is a JSON object, but it does not contain a property named shares, the test outcome is inapplicable.

Test Targets

  1. shares - the shares collection derived from the input object and its shares property

Expectations

  1. shares is a JSON object
  2. shares has a property named type
  3. the values of the shares target's type property must indicate that the value is either an OrderedCollection or a Collection as determined by:

Assumptions

Interpreting "MUST be either an OrderedCollection or a Collection"

This test chose to interpret 'MUST be… an' to include 'indicate its type as'. The rationale is:

Test Cases

simple passed case

inputs

test targets

object.shares is a number

inputs

test targets

object is number

inputs

result

Glossary

outcome

An outcome is a conclusion that comes from evaluating a test on a test subject. An outcome can be one of the three following types:

Requirements Mapping

Change Log

Issues