@serenity-js/core
Version:
The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure
34 lines • 1.47 kB
JavaScript
import { ensure, isDefined } from 'tiny-types';
import { Path } from '../io/index.js';
import { Artifact, CorrelationId, Name } from '../model/index.js';
import { Timestamp } from '../screenplay/index.js';
import { ArtifactArchived } from './ArtifactArchived.js';
// todo: there should be two types of events here:
// - ActivityArtifactGenerated
// - SceneArtifactGenerated
/**
* @group Events
*/
export class ActivityRelatedArtifactArchived extends ArtifactArchived {
activityId;
static fromJSON(o) {
return new ActivityRelatedArtifactArchived(CorrelationId.fromJSON(o.sceneId), CorrelationId.fromJSON(o.activityId), Name.fromJSON(o.name), Artifact.ofType(o.type), Path.fromJSON(o.path), Timestamp.fromJSON(o.artifactTimestamp), Timestamp.fromJSON(o.timestamp));
}
constructor(sceneId, activityId, name, type, path, artifactTimestamp, timestamp) {
super(sceneId, name, type, path, artifactTimestamp, timestamp);
this.activityId = activityId;
ensure('activityId', activityId, isDefined());
}
toJSON() {
return {
sceneId: this.sceneId.toJSON(),
activityId: this.activityId.toJSON(),
name: this.name.toJSON(),
type: this.type.name,
path: this.path.toJSON(),
artifactTimestamp: this.artifactTimestamp.toJSON(),
timestamp: this.timestamp.toJSON(),
};
}
}
//# sourceMappingURL=ActivityRelatedArtifactArchived.js.map