use of org.jboss.tools.openshift.internal.common.core.security.SecureStore.IStoreKey in project jbosstools-openshift by jbosstools.
the class SecureStorageTest method shouldRemoveNode.
@Test
public void shouldRemoveNode() throws SecureStoreException {
// pre-condition
IStoreKey key = new OpenShiftSecureStorageKey("org.jboss.tools.openshift.test", "localhost", "foobar");
SecureStore store = new SecureStore(key);
store.put("password", "chocolate");
assertTrue(SecurePreferencesFactory.getDefault().nodeExists(key.getKey()));
// operation
store.removeNode();
// verification
assertFalse(SecurePreferencesFactory.getDefault().nodeExists(key.getKey()));
}
use of org.jboss.tools.openshift.internal.common.core.security.SecureStore.IStoreKey in project jbosstools-openshift by jbosstools.
the class ConnectionTest method should_clear_secure_data_when_connection_deleted.
@Test
public void should_clear_secure_data_when_connection_deleted() throws MalformedURLException {
// pre-conditions
Connection connection = ConnectionTestUtils.createConnection("bdshadow", "13", "https://localhost.com");
connection.connect();
// when
IStoreKey key = new OpenShiftSecureStorageKey(Connection.SECURE_STORAGE_BASEKEY, connection.getHost(), connection.getUsername());
assertTrue(SecurePreferencesFactory.getDefault().nodeExists(key.getKey()));
connection.removeSecureStoreData();
// then
assertFalse(SecurePreferencesFactory.getDefault().nodeExists(key.getKey()));
}
Aggregations