use of org.opencastproject.presets.api.PresetProvider in project opencast by opencast.
the class DefaultsWorkflowOperationHandlerTest method usesOrganizationLevelPresetNullSeries.
@Test
public void usesOrganizationLevelPresetNullSeries() throws WorkflowOperationException, NotFoundException {
Organization organization = EasyMock.createMock(Organization.class);
EasyMock.replay(organization);
String seriesID = null;
presetProvider = EasyMock.createMock(PresetProvider.class);
EasyMock.expect(presetProvider.getProperty(seriesID, OPT_KEY)).andReturn(ORGANIZATION_PRESET_VALUE);
EasyMock.replay(presetProvider);
// Workflow configuration
Map<String, String> workflowConfiguration = new HashMap<String, String>();
workflowConfiguration.put(OPT_KEY, WORKFLOW_PRESET_VALUE);
WorkflowInstance workflowInstance = setupInstance(organization, seriesID, workflowConfiguration, false);
DefaultsWorkflowOperationHandler handler = new DefaultsWorkflowOperationHandler();
handler.setPresetProvider(presetProvider);
WorkflowOperationResult result = handler.start(workflowInstance, null);
assertEquals(ORGANIZATION_PRESET_VALUE, result.getProperties().get(OPT_KEY));
}
use of org.opencastproject.presets.api.PresetProvider in project opencast by opencast.
the class DefaultsWorkflowOperationHandlerTest method usesOrganizationLevelPreset.
@Test
public void usesOrganizationLevelPreset() throws WorkflowOperationException, NotFoundException {
Organization organization = EasyMock.createMock(Organization.class);
EasyMock.replay(organization);
String seriesID = "series-ID";
presetProvider = EasyMock.createMock(PresetProvider.class);
EasyMock.expect(presetProvider.getProperty(seriesID, OPT_KEY)).andReturn(ORGANIZATION_PRESET_VALUE);
EasyMock.replay(presetProvider);
// Workflow configuration
Map<String, String> workflowConfiguration = new HashMap<String, String>();
workflowConfiguration.put(OPT_KEY, WORKFLOW_PRESET_VALUE);
WorkflowInstance workflowInstance = setupInstance(organization, seriesID, workflowConfiguration, false);
DefaultsWorkflowOperationHandler handler = new DefaultsWorkflowOperationHandler();
handler.setPresetProvider(presetProvider);
WorkflowOperationResult result = handler.start(workflowInstance, null);
assertEquals(ORGANIZATION_PRESET_VALUE, result.getProperties().get(OPT_KEY));
}
use of org.opencastproject.presets.api.PresetProvider in project opencast by opencast.
the class DefaultsWorkflowOperationHandlerTest method usesWorkflowLevelPresetDueToNotFound.
@Test
public void usesWorkflowLevelPresetDueToNotFound() throws WorkflowOperationException, NotFoundException {
Organization organization = EasyMock.createMock(Organization.class);
EasyMock.replay(organization);
String seriesID = "series-ID";
presetProvider = EasyMock.createMock(PresetProvider.class);
EasyMock.expect(presetProvider.getProperty(seriesID, OPT_KEY)).andThrow(new NotFoundException());
EasyMock.replay(presetProvider);
// Workflow configuration
Map<String, String> workflowConfiguration = new HashMap<String, String>();
workflowConfiguration.put(OPT_KEY, WORKFLOW_PRESET_VALUE);
WorkflowInstance workflowInstance = setupInstance(organization, seriesID, workflowConfiguration, false);
DefaultsWorkflowOperationHandler handler = new DefaultsWorkflowOperationHandler();
handler.setPresetProvider(presetProvider);
WorkflowOperationResult result = handler.start(workflowInstance, null);
assertEquals(WORKFLOW_PRESET_VALUE, result.getProperties().get(OPT_KEY));
}
use of org.opencastproject.presets.api.PresetProvider in project opencast by opencast.
the class DefaultsWorkflowOperationHandlerTest method usesSeriesLevelPreset.
@Test
public void usesSeriesLevelPreset() throws WorkflowOperationException, NotFoundException {
Organization organization = EasyMock.createMock(Organization.class);
EasyMock.replay(organization);
String seriesID = "series-ID";
presetProvider = EasyMock.createMock(PresetProvider.class);
EasyMock.expect(presetProvider.getProperty(seriesID, OPT_KEY)).andReturn(SERIES_PRESET_VALUE);
EasyMock.replay(presetProvider);
// Workflow configuration
Map<String, String> workflowConfiguration = new HashMap<String, String>();
workflowConfiguration.put(OPT_KEY, WORKFLOW_PRESET_VALUE);
WorkflowInstance workflowInstance = setupInstance(organization, seriesID, workflowConfiguration, false);
DefaultsWorkflowOperationHandler handler = new DefaultsWorkflowOperationHandler();
handler.setPresetProvider(presetProvider);
WorkflowOperationResult result = handler.start(workflowInstance, null);
assertEquals(SERIES_PRESET_VALUE, result.getProperties().get(OPT_KEY));
}
use of org.opencastproject.presets.api.PresetProvider in project opencast by opencast.
the class DefaultsWorkflowOperationHandlerTest method usesWorkflowLevelPreset.
@Test
public void usesWorkflowLevelPreset() throws WorkflowOperationException, NotFoundException {
Organization organization = EasyMock.createMock(Organization.class);
EasyMock.replay(organization);
String seriesID = "series-ID";
presetProvider = EasyMock.createMock(PresetProvider.class);
EasyMock.expect(presetProvider.getProperty(seriesID, OPT_KEY)).andReturn(null);
EasyMock.replay(presetProvider);
// Workflow configuration
Map<String, String> workflowConfiguration = new HashMap<String, String>();
workflowConfiguration.put(OPT_KEY, WORKFLOW_PRESET_VALUE);
WorkflowInstance workflowInstance = setupInstance(organization, seriesID, workflowConfiguration, false);
DefaultsWorkflowOperationHandler handler = new DefaultsWorkflowOperationHandler();
handler.setPresetProvider(presetProvider);
WorkflowOperationResult result = handler.start(workflowInstance, null);
assertEquals(WORKFLOW_PRESET_VALUE, result.getProperties().get(OPT_KEY));
}
Aggregations