@Test public void fileBasedSshTransportCallbackCreated() throws Exception { SshUriProperties dontIgnoreLocalSettings = SshUri.builder() .uri("user@gitrepo.com:proj/repo") .ignoreLocalSshSettings(false) .build(); TransportConfiguration transportConfiguration = new TransportConfiguration(); TransportConfigCallback transportConfigCallback = transportConfiguration.propertiesBasedSshTransportCallback(dontIgnoreLocalSettings); assertThat(transportConfigCallback, is(instanceOf(TransportConfiguration.FileBasedSshTransportConfigCallback.class))); }
@ConditionalOnMissingBean(TransportConfigCallback.class) @Bean public TransportConfigCallback propertiesBasedSshTransportCallback(final SshUriProperties sshUriProperties) { if(sshUriProperties.isIgnoreLocalSshSettings()) { return new PropertiesBasedSshTransportConfigCallback(sshUriProperties); } else return new FileBasedSshTransportConfigCallback(sshUriProperties); }
TransportConfiguration { @ConditionalOnMissingBean(TransportConfigCallback.class) @Bean public TransportConfigCallback propertiesBasedSshTransportCallback(final SshUriProperties sshUriProperties) { if(sshUriProperties.isIgnoreLocalSshSettings()) { return new PropertiesBasedSshTransportConfigCallback(sshUriProperties); } else return new FileBasedSshTransportConfigCallback(sshUriProperties); } }
TransportConfiguration { @ConditionalOnMissingBean(TransportConfigCallback.class) @Bean public TransportConfigCallback propertiesBasedSshTransportCallback(final SshUriProperties sshUriProperties) { if(sshUriProperties.isIgnoreLocalSshSettings()) { return new PropertiesBasedSshTransportConfigCallback(sshUriProperties); } else return new FileBasedSshTransportConfigCallback(sshUriProperties); }  }
TransportConfiguration { @ConditionalOnMissingBean(TransportConfigCallback.class) @Bean public TransportConfigCallback propertiesBasedSshTransportCallback(final SshUriProperties sshUriProperties) { if(sshUriProperties.isIgnoreLocalSshSettings()) { return new PropertiesBasedSshTransportConfigCallback(sshUriProperties); } else return new FileBasedSshTransportConfigCallback(sshUriProperties); }  @ConditionalOnMissingBean(TransportConfigCallback.class) @Bean TransportConfigCallback propertiesBasedSshTransportCallback(final SshUriProperties sshUriProperties); }
TransportConfiguration { @ConditionalOnMissingBean(TransportConfigCallback.class) @Bean public TransportConfigCallback propertiesBasedSshTransportCallback(final SshUriProperties sshUriProperties) { if(sshUriProperties.isIgnoreLocalSshSettings()) { return new PropertiesBasedSshTransportConfigCallback(sshUriProperties); } else return new FileBasedSshTransportConfigCallback(sshUriProperties); }  @ConditionalOnMissingBean(TransportConfigCallback.class) @Bean TransportConfigCallback propertiesBasedSshTransportCallback(final SshUriProperties sshUriProperties);  }