@Test
public void testGetData() throws Exception {

	DDMDataProviderRequest.Builder builder =
		DDMDataProviderRequest.Builder.newBuilder();
	DDMDataProviderRequest ddmDataProviderRequest = builder.withGroupId(
		1
	).build();
	long[] groups = {1, 2};
	when(
		_portal.getCurrentAndAncestorSiteGroupIds(1)
	).thenReturn(
		groups
	);
	DDMDataProviderInstance ddmDataProviderInstance1 =
		_createDDMDataProviderInstanceMock(1, "Data Provider Instance 1");
	DDMDataProviderInstance ddmDataProviderInstance2 =
		_createDDMDataProviderInstanceMock(2, "Data Provider Instance 2");
	when(
		_ddmDataProviderInstanceLocalService.getDataProviderInstances(
			groups)
	).thenReturn(
		Arrays.asList(ddmDataProviderInstance1, ddmDataProviderInstance2)
	);
	DDMDataProviderResponse ddmDataProviderResponse =
		_ddmDataProviderInstancesDataProvider.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("1", "Data Provider Instance 1"));
			add(new KeyValuePair("2", "Data Provider Instance 2"));
		}
	};
	Assert.assertEquals(keyValuePairs, optional.get());
}