@Test
public void testGetWorkflowDefinitions() throws Exception {

	DDMDataProviderRequest.Builder builder =
		DDMDataProviderRequest.Builder.newBuilder();
	DDMDataProviderRequest ddmDataProviderRequest = builder.withLocale(
		_locale
	).withCompanyId(
		1L
	).build();
	_workflowDefinitionsDataProvider.workflowDefinitionManager =
		_workflowDefinitionManager;
	WorkflowDefinition workflowDefinition1 = mock(WorkflowDefinition.class);
	_setUpWorkflowDefinition(
		workflowDefinition1, "definition1", 1, "Definition 1");
	WorkflowDefinition workflowDefinition2 = mock(WorkflowDefinition.class);
	_setUpWorkflowDefinition(
		workflowDefinition2, "definition2", 2, "Definition 2");
	when(
		_workflowDefinitionManager.getActiveWorkflowDefinitions(
			1, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)
	).thenReturn(
		Arrays.asList(workflowDefinition1, workflowDefinition2)
	);
	DDMDataProviderResponse ddmDataProviderResponse =
		_workflowDefinitionsDataProvider.getData(ddmDataProviderRequest);
	Assert.assertTrue(ddmDataProviderResponse.hasOutput("Default-Output"));
	Optional<List<KeyValuePair>> optional =
		ddmDataProviderResponse.getOutputOptional(
			"Default-Output", List.class);
	Assert.assertTrue(optional.isPresent());
	List<KeyValuePair> keyValuePairs = new ArrayList<KeyValuePair>() {
		{
			add(new KeyValuePair("no-workflow", "No Workflow"));
			add(new KeyValuePair("definition1@1", "Definition 1"));
			add(new KeyValuePair("definition2@2", "Definition 2"));
		}
	};
	Assert.assertEquals(keyValuePairs, optional.get());
}