Search in sources :

Example 1 with DataProviderKeys

use of org.finra.herd.model.api.xml.DataProviderKeys in project herd by FINRAOS.

the class DataProviderServiceImpl method getDataProviders.

@Override
public DataProviderKeys getDataProviders() {
    DataProviderKeys dataProviderKeys = new DataProviderKeys();
    dataProviderKeys.getDataProviderKeys().addAll(dataProviderDao.getDataProviders());
    return dataProviderKeys;
}
Also used : DataProviderKeys(org.finra.herd.model.api.xml.DataProviderKeys)

Example 2 with DataProviderKeys

use of org.finra.herd.model.api.xml.DataProviderKeys in project herd by FINRAOS.

the class DataProviderRestControllerTest method testGetDataProviders.

@Test
public void testGetDataProviders() throws Exception {
    DataProviderKeys dataProviderKeys = new DataProviderKeys(Arrays.asList(new DataProviderKey(DATA_PROVIDER_NAME), new DataProviderKey(DATA_PROVIDER_NAME_2)));
    when(dataProviderService.getDataProviders()).thenReturn(dataProviderKeys);
    // Retrieve a list of data provider keys.
    DataProviderKeys resultDataProviderKeys = dataProviderRestController.getDataProviders();
    // Verify the external calls.
    verify(dataProviderService).getDataProviders();
    verifyNoMoreInteractions(dataProviderService);
    // Validate the returned object.
    assertEquals(dataProviderKeys, resultDataProviderKeys);
}
Also used : DataProviderKeys(org.finra.herd.model.api.xml.DataProviderKeys) DataProviderKey(org.finra.herd.model.api.xml.DataProviderKey) Test(org.junit.Test)

Example 3 with DataProviderKeys

use of org.finra.herd.model.api.xml.DataProviderKeys in project herd by FINRAOS.

the class DataProviderServiceTest method testGetDataProviders.

@Test
public void testGetDataProviders() throws Exception {
    // Create and persist data provider entities.
    for (DataProviderKey key : DATA_PROVIDER_KEYS) {
        dataProviderDaoTestHelper.createDataProviderEntity(key.getDataProviderName());
    }
    // Retrieve a list of data provider keys.
    DataProviderKeys resultDataProviderKeys = dataProviderService.getDataProviders();
    // Validate the returned object.
    assertEquals(DATA_PROVIDER_KEYS, resultDataProviderKeys.getDataProviderKeys());
}
Also used : DataProviderKeys(org.finra.herd.model.api.xml.DataProviderKeys) DataProviderKey(org.finra.herd.model.api.xml.DataProviderKey) Test(org.junit.Test)

Aggregations

DataProviderKeys (org.finra.herd.model.api.xml.DataProviderKeys)3 DataProviderKey (org.finra.herd.model.api.xml.DataProviderKey)2 Test (org.junit.Test)2