Skip to content

Instantly share code, notes, and snippets.

'use strict';
const mocha = require('mocha');
const chai = require('chai');
const chaiAsPromised = require("chai-as-promised");
const should = chai.should();
const sinon = require('sinon');
const expect = chai.expect;
const ninjsConverter = require('../../lib/converters/ninjs-converter');
{"name":"ingest/content/images/v1","hostname":"HDRevan.local","pid":52922,"correlationId":"9ff954d3-8d1a-4c14-aa1d-141a911fa60e","level":50,"error":"Invalid JSON: Unknown key 'profile' with value: country","causedBy":{"status":400},"isClientError":true,"data":{"service":{"name":"pipeline/content/v1","id":"6cdc8404-7755-4a12-9b66-0647946d3669","address":"10.12.225.33","port":35097,"sslPort":null,"payload":null,"registrationTimeUTC":1500029540548,"serviceType":"DYNAMIC","uriSpec":"http://10.12.225.33:35097","serviceUrl":"http://10.12.225.33:35097/pipeline/content/v1"},"method":"POST","uri":"route/item/receiver","url":"http://10.12.225.33:35097/pipeline/content/v1/route/item/receiver"},"msg":"Notification processing failed","time":"2017-07-28T14:23:56.162Z","v":0}
{"profile":"asset","type":"picture","version":"1","representationtype":"complete","firstcreated":"2017-07-28T15:06:22Z","versioncreated":"2017-07-28T15:06:22Z","pubstatus":"usable","language":"en","byline":"Jeff Holmes","headline":"Celtic Fans File Photo","description_text":"File photo dated 20-07-2017 of Celtic fans","body_text":"File photo dated 20-07-2017 of Celtic fans","copyrightholder":"PA WIRE","copyrightnotice":"PA Wire/PA Images","usageterms":"FILE PHOTO","place":[{"code":"country:uk","name":"UK","profile":"country","scheme":"http://images-metadata-repository/v1/place","rel":"mentions"},{"code":"city:glasgow","name":"Glasgow","profile":"city","scheme":"http://images-metadata-repository/v1/place","rel":"mentions"}],"object":[{"code":"2.32216566","rel":"source","scheme":"http://images-repository/v1/item"},{"code":"paimagescopyright:227","profile":"paimagescopyright","scheme":"http://images-metadata-repository/v1/object","rel":"classifiedAs"},{"code":"paimagescopyright:pa-wire","profile":"paimagescopyri
{"profile":"asset","type":"picture","version":"1","representationtype":"complete","firstcreated":"2017-07-28T15:06:22Z","versioncreated":"2017-07-28T15:06:22Z","pubstatus":"usable","language":"en","byline":"Jeff Holmes","headline":"Celtic Fans File Photo","description_text":"File photo dated 20-07-2017 of Celtic fans","body_text":"File photo dated 20-07-2017 of Celtic fans","copyrightholder":"PA WIRE","copyrightnotice":"PA Wire/PA Images","usageterms":"FILE PHOTO","place":[{"code":"country:uk","name":"UK","profile":"country","scheme":"http://images-metadata-repository/v1/place","rel":"mentions"},{"code":"city:glasgow","name":"Glasgow","profile":"city","scheme":"http://images-metadata-repository/v1/place","rel":"mentions"}],"object":[{"code":"2.32216566","rel":"source","scheme":"http://images-repository/v1/item"},{"code":"paimagescopyright:227","profile":"paimagescopyright","scheme":"http://images-metadata-repository/v1/object","rel":"classifiedAs"},{"code":"paimagescopyright:pa-wire","profile":"paimagescopyri
{"statusCode":202,"headers":{"server":"Apache-Coyote/1.1","x-unity-correlationid":"ecac60ed-73a4-11e7-bf0e-0050568936bb","access-control-allow-origin":"*","access-control-allow-methods":"GET, HEAD, PUT, PATCH, POST, DELETE, OPTIONS","access-control-max-age":"3600","x-powered-by":"Unity","vary":"Accept, Authorization, apikey","x-application-context":"application:35097","breadcrumbid":"ID-padevsvc01-staging-ixdev-pacpservices-net-46089-1500029535173-0-639","camelhttpresponsecode":"202","correlationid":"ecac60ed-73a4-11e7-bf0e-0050568936bb","content-type":"application/json","content-length":"0","date":"Fri, 28 Jul 2017 14:56:23 GMT","connection":"close"},"request":{"uri":{"protocol":"http:","slashes":true,"auth":null,"host":"10.12.225.33:35097","port":"35097","hostname":"10.12.225.33","hash":null,"search":null,"query":null,"pathname":"/pipeline/content/v1/route/item/receiver","path":"/pipeline/content/v1/route/item/receiver","href":"http://10.12.225.33:35097/pipeline/content/v1/route/item/receiver"},"method":"PO
{
"name": "ingest/content/images/v1",
"hostname": "HDRevan.local",
"pid": 79611,
"level": 30,
"entityUri": "2.32244267",
"msg": "IncomingMessage {\n _readableState: \n ReadableState {\n objectMode: false,\n highWaterMark: 16384,\n buffer: BufferList { head: null, tail: null, length: 0 },\n length: 0,\n pipes: null,\n pipesCount: 0,\n flowing: true,\n ended: true,\n endEmitted: true,\n reading: false,\n sync: true,\n needReadable: false,\n emittedReadable: false,\n readableListening: false,\n resumeScheduled: false,\n defaultEncoding: 'utf8',\n ranOut: false,\n awaitDrain: 0,\n readingMore: false,\n decoder: null,\n encoding: null },\n readable: false,\n domain: null,\n _events: \n { end: [ [Function: responseOnEnd], [Function], [Function], [Function] ],\n close: [ [Function], [Function] ],\n data: [Function],\n error: [Function] },\n _eventsCount: 4,\n _maxListeners: undefined,\n socket: \n
default:
#
# Basic
#
server:
port: 8005
#
# Microservice
'use strict';
/**
* class for holding and retrieving PA services names
*/
class PaServices {
/**
* Get service name provided service code.
*
* @param serviceCode PA service code
'use strict';
/**
* class for holding and retrieving PA services names
*/
class PaServices {
/**
* Get service name provided service code.
*
* @param serviceCode PA service code
'use strict';
const oldSportSubServiceMap = require('../../config/mapping/old-sport-sub-services.json');
const sportObjectMap = require('../../config/mapping/sport-objects.json');
const OBJECT_CODE = "paoperation:disable-publication";
const OBJECT_NAME = 'Disable Publication';
const OBJECT_REL = 'operation';
const OBJECT_PROFILE = 'paoperation';
const OBJECT_SCHEME = 'http://content-repository/v1/object';