Search in sources :

Example 61 with ApplicationDAO

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);
}
Also used : ApplicationDAO(org.wso2.carbon.apimgt.core.dao.ApplicationDAO) Test(org.testng.annotations.Test)

Example 62 with ApplicationDAO

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);
}
Also used : ApplicationDAO(org.wso2.carbon.apimgt.core.dao.ApplicationDAO) Application(org.wso2.carbon.apimgt.core.models.Application) Test(org.testng.annotations.Test)

Aggregations

ApplicationDAO (org.wso2.carbon.apimgt.core.dao.ApplicationDAO)62 Test (org.testng.annotations.Test)56 Application (org.wso2.carbon.apimgt.core.models.Application)50 BeforeTest (org.testng.annotations.BeforeTest)32 APIStore (org.wso2.carbon.apimgt.core.api.APIStore)32 WorkflowDAO (org.wso2.carbon.apimgt.core.dao.WorkflowDAO)21 APIGateway (org.wso2.carbon.apimgt.core.api.APIGateway)18 APISubscriptionDAO (org.wso2.carbon.apimgt.core.dao.APISubscriptionDAO)18 PolicyDAO (org.wso2.carbon.apimgt.core.dao.PolicyDAO)15 ApplicationPolicy (org.wso2.carbon.apimgt.core.models.policy.ApplicationPolicy)15 APIMgtDAOException (org.wso2.carbon.apimgt.core.exception.APIMgtDAOException)13 SubscriptionPolicy (org.wso2.carbon.apimgt.core.models.policy.SubscriptionPolicy)13 API (org.wso2.carbon.apimgt.core.models.API)12 Policy (org.wso2.carbon.apimgt.core.models.policy.Policy)10 SQLException (java.sql.SQLException)8 APIBuilder (org.wso2.carbon.apimgt.core.models.API.APIBuilder)7 ApiDAO (org.wso2.carbon.apimgt.core.dao.ApiDAO)6 WorkflowResponse (org.wso2.carbon.apimgt.core.api.WorkflowResponse)5 CompositeAPI (org.wso2.carbon.apimgt.core.models.CompositeAPI)5 Subscription (org.wso2.carbon.apimgt.core.models.Subscription)4