use of org.wso2.carbon.apimgt.core.dao.ApplicationDAO in project carbon-apimgt by wso2.
the class AbstractAPIManagerTestCase method testGetLastUpdatedTimeOfApplication.
@Test(description = "Getting last updated time of Application")
public void testGetLastUpdatedTimeOfApplication() throws APIManagementException {
ApplicationDAO applicationDAO = mock(ApplicationDAO.class);
AbstractAPIManager apiStore = getAPIStoreImpl(applicationDAO);
when(applicationDAO.getLastUpdatedTimeOfApplication(UUID)).thenReturn(LAST_UPDATED_TIME);
apiStore.getLastUpdatedTimeOfApplication(UUID);
verify(applicationDAO, times(1)).getLastUpdatedTimeOfApplication(UUID);
}
use of org.wso2.carbon.apimgt.core.dao.ApplicationDAO in project carbon-apimgt by wso2.
the class AbstractAPIManagerTestCase method testGetApplicationByUuid.
@Test(description = "Retrieve an application by uuid")
public void testGetApplicationByUuid() throws APIManagementException {
ApplicationDAO applicationDAO = mock(ApplicationDAO.class);
AbstractAPIManager apiStore = getAPIStoreImpl(applicationDAO);
Application applicationFromDAO = new Application(APP_NAME, USER_NAME);
when(applicationDAO.getApplication(UUID)).thenReturn(applicationFromDAO);
Application application = apiStore.getApplication(UUID, USER_NAME);
Assert.assertNotNull(application);
verify(applicationDAO, times(1)).getApplication(UUID);
}
Aggregations