diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ssh/PropertyBasedSshSessionFactoryTest.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ssh/PropertyBasedSshSessionFactoryTest.java index 680c546a..c039807f 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ssh/PropertyBasedSshSessionFactoryTest.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ssh/PropertyBasedSshSessionFactoryTest.java @@ -277,10 +277,15 @@ public class PropertyBasedSshSessionFactoryTest { @Test public void defaultSshConfigIsSet() { - setupSessionFactory(new JGitEnvironmentProperties()); + JGitEnvironmentProperties sshProperties = new JGitEnvironmentProperties(); + sshProperties.setUri("ssh://gitlab.example.local:3322/somerepo.git"); + setupSessionFactory(sshProperties); - assertThatThrownBy(() -> getDefaultSshHostConfig("host.name", 123, "user.name")) - .isInstanceOf(NullPointerException.class); + SshConfigStore.HostConfig sshConfig = getDefaultSshHostConfig("gitlab.example.local", 123, "user.name"); + + assertThat(sshConfig.getValue("HostName")).isEqualTo("gitlab.example.local"); + assertThat(sshConfig.getValue("Port")).isEqualTo("123"); + assertThat(sshConfig.getValue("User")).isEqualTo("user.name"); } @Test