PublishEngageWorkflowOperationHandler extends AbstractWorkflowOperationHandler { URI createEngageUri(URI engageUri, MediaPackage mp) { return URIUtils.resolve(engageUri, PLAYER_PATH + mp.getIdentifier().toString()); }  void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService); @Override WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context);  }
@Test public void testPlayerUrl() throws WorkflowOperationException, URISyntaxException { URI engageURI = new URI("http: String mpId = "mp-id"; MediaPackage mp = EasyMock.createNiceMock(MediaPackage.class); Id id = new IdImpl(mpId); EasyMock.expect(mp.getIdentifier()).andStubReturn(id); MediaPackageElement element = EasyMock.createNiceMock(MediaPackageElement.class); EasyMock.replay(element, mp); PublishEngageWorkflowOperationHandler publishEngagePublish = new PublishEngageWorkflowOperationHandler(); URI result = publishEngagePublish.createEngageUri(engageURI, mp); assertEquals(engageURI.toString() + "/play/" + mpId, result.toString()); }
@Test public void testDefaultPlayerPath() throws URISyntaxException { URI engageURI = new URI("http: String mpId = "mp-id"; MediaPackage mp = EasyMock.createNiceMock(MediaPackage.class); Id id = new IdImpl(mpId); EasyMock.expect(mp.getIdentifier()).andStubReturn(id); MediaPackageElement element = EasyMock.createNiceMock(MediaPackageElement.class); EasyMock.replay(element, mp); PublishEngageWorkflowOperationHandler publishEngagePublish = new PublishEngageWorkflowOperationHandler(); URI result = publishEngagePublish.createEngageUri(engageURI, mp); assertEquals(engageURI.toString() + PublishEngageWorkflowOperationHandler.PLAYER_PATH + mpId, result.toString()); }