Search in sources :

Example 26 with ConnectionServiceException

use of org.pentaho.platform.dataaccess.datasource.wizard.service.ConnectionServiceException in project data-access by pentaho.

the class MetadataServiceTest method testRemoveMetadataError.

@Test
public void testRemoveMetadataError() throws Exception {
    ConnectionServiceException cse = new ConnectionServiceException();
    doThrow(cse).when(metadataService).ensureDataAccessPermissionCheck();
    try {
        metadataService.removeMetadata("metadataId");
        fail();
    } catch (PentahoAccessControlException e) {
    // expected
    }
    verify(metadataService, times(1)).removeMetadata("metadataId");
}
Also used : ConnectionServiceException(org.pentaho.platform.dataaccess.datasource.wizard.service.ConnectionServiceException) PentahoAccessControlException(org.pentaho.platform.api.engine.PentahoAccessControlException) Test(org.junit.Test)

Aggregations

ConnectionServiceException (org.pentaho.platform.dataaccess.datasource.wizard.service.ConnectionServiceException)26 IDatabaseConnection (org.pentaho.database.model.IDatabaseConnection)9 Test (org.junit.Test)8 DatabaseDialectException (org.pentaho.database.DatabaseDialectException)8 DatasourceMgmtServiceException (org.pentaho.platform.api.repository.datasource.DatasourceMgmtServiceException)8 PentahoAccessControlException (org.pentaho.platform.api.engine.PentahoAccessControlException)6 DatasourceServiceException (org.pentaho.platform.dataaccess.datasource.wizard.service.DatasourceServiceException)6 Path (javax.ws.rs.Path)4 IDatabaseDialect (org.pentaho.database.IDatabaseDialect)4 DuplicateDatasourceException (org.pentaho.platform.api.repository.datasource.DuplicateDatasourceException)4 NonExistingDatasourceException (org.pentaho.platform.api.repository.datasource.NonExistingDatasourceException)4 ArrayList (java.util.ArrayList)3 GET (javax.ws.rs.GET)3 Produces (javax.ws.rs.Produces)3 WebApplicationException (javax.ws.rs.WebApplicationException)3 Response (javax.ws.rs.core.Response)3 DatabaseDialectService (org.pentaho.database.service.DatabaseDialectService)3 Database (org.pentaho.di.core.database.Database)3 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)3 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)3