Search in sources :

Example 1 with TestConnectionDetails

use of org.pentaho.di.connections.common.bucket.TestConnectionDetails in project pentaho-kettle by pentaho.

the class ConnectionManagerTest method testSaveConnection.

@Test
public void testSaveConnection() {
    addOne();
    TestConnectionDetails testConnectionDetails1 = (TestConnectionDetails) connectionManager.getConnectionDetails(TestConnectionProvider.SCHEME, CONNECTION_NAME);
    Assert.assertEquals(CONNECTION_NAME, testConnectionDetails1.getName());
}
Also used : TestConnectionDetails(org.pentaho.di.connections.common.bucket.TestConnectionDetails) Test(org.junit.Test)

Example 2 with TestConnectionDetails

use of org.pentaho.di.connections.common.bucket.TestConnectionDetails in project pentaho-kettle by pentaho.

the class ConnectionManagerTest method testEncryptedField.

@Test
public void testEncryptedField() throws Exception {
    addOne();
    TestConnectionDetails testConnectionDetails1 = (TestConnectionDetails) connectionManager.getConnectionDetails(TestConnectionProvider.SCHEME, CONNECTION_NAME);
    Assert.assertEquals(PASSWORD, testConnectionDetails1.getPassword());
    Assert.assertEquals(PASSWORD2, testConnectionDetails1.getPassword1());
    MetaStoreFactory<TestConnectionDetails> metaStoreFactory = new MetaStoreFactory<>(TestConnectionDetails.class, memoryMetaStore, NAMESPACE);
    TestConnectionDetails testConnectionDetails = metaStoreFactory.loadElement(CONNECTION_NAME);
    Assert.assertTrue(testConnectionDetails.getPassword().startsWith("Encrypted "));
    Assert.assertTrue(testConnectionDetails.getPassword1().startsWith("Encrypted "));
}
Also used : MetaStoreFactory(org.pentaho.metastore.persist.MetaStoreFactory) TestConnectionDetails(org.pentaho.di.connections.common.bucket.TestConnectionDetails) Test(org.junit.Test)

Example 3 with TestConnectionDetails

use of org.pentaho.di.connections.common.bucket.TestConnectionDetails in project pentaho-kettle by pentaho.

the class ConnectionManagerTest method addOne.

private void addOne() {
    addProvider();
    TestConnectionDetails testConnectionDetails = new TestConnectionDetails();
    testConnectionDetails.setDescription(DESCRIPTION);
    testConnectionDetails.setName(CONNECTION_NAME);
    testConnectionDetails.setPassword(PASSWORD);
    testConnectionDetails.setPassword1(PASSWORD2);
    connectionManager.save(testConnectionDetails);
}
Also used : TestConnectionDetails(org.pentaho.di.connections.common.bucket.TestConnectionDetails)

Example 4 with TestConnectionDetails

use of org.pentaho.di.connections.common.bucket.TestConnectionDetails in project pentaho-kettle by pentaho.

the class ConnectionFileProviderTest method addOne.

private void addOne() {
    addProvider();
    TestConnectionDetails testConnectionDetails = new TestConnectionDetails();
    testConnectionDetails.setName(CONNECTION_NAME);
    connectionManager.save(testConnectionDetails);
}
Also used : TestConnectionDetails(org.pentaho.di.connections.common.bucket.TestConnectionDetails)

Aggregations

TestConnectionDetails (org.pentaho.di.connections.common.bucket.TestConnectionDetails)4 Test (org.junit.Test)2 MetaStoreFactory (org.pentaho.metastore.persist.MetaStoreFactory)1