use of org.eclipse.linuxtools.docker.core.IDockerConnectionStorageManager in project linuxtools by eclipse.
the class EditDockerConnectionSWTBotTest method shouldSaveConnectionWhenNameAndTCPConnectionSettingsChanged.
@SuppressWarnings("unchecked")
@Test
public void shouldSaveConnectionWhenNameAndTCPConnectionSettingsChanged() {
// given
final IDockerConnection connection = configureTCPConnection("Test");
final IDockerConnectionStorageManager connectionStorageManager = MockDockerConnectionStorageManagerFactory.providing(connection);
DockerConnectionManagerUtils.configureConnectionManager(connectionStorageManager);
final SWTBotTreeItem connectionTreeItem = SWTUtils.getTreeItem(dockerExplorer.bot(), "Test");
assertThat(connectionTreeItem).isNotNull();
// let's ignore the connection savings that may have occurred when
// adding elements from the extension points
Mockito.reset(connectionStorageManager);
// when
openConnectionEditionWizard("Test");
bot.text(0).setText("foo");
bot.text(2).setText("https://foo.bar:1234");
getFinishButton().click();
// then
final IDockerConnection foundConnection = DockerConnectionManager.getInstance().findConnection("foo");
assertThat(foundConnection).isNotNull();
assertThat(foundConnection.getSettings()).isNotNull().isEqualTo(new TCPConnectionSettings("https://foo.bar:1234", PATH_TO_CERTS));
Mockito.verify(connectionStorageManager).saveConnections(Matchers.anyList());
}
Aggregations