Java 类org.springframework.boot.actuate.autoconfigure.ShellProperties.KeyAuthenticationProperties 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ShellPropertiesTests.java   
@Test
public void testBindingKey() {
    KeyAuthenticationProperties props = load(KeyAuthenticationProperties.class,
            "management.shell.auth.key.path=~/.ssh/test.pem");
    Properties p = new Properties();
    props.applyToCrshShellConfig(p);
    assertThat(p.get("crash.auth.key.path")).isEqualTo("~/.ssh/test.pem");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ShellPropertiesTests.java   
@Test
public void testBindingKeyIgnored() {
    KeyAuthenticationProperties props = load(KeyAuthenticationProperties.class);
    Properties p = new Properties();
    props.applyToCrshShellConfig(p);
    assertThat(p.get("crash.auth.key.path")).isNull();
}
项目:spring-boot-concourse    文件:ShellPropertiesTests.java   
@Test
public void testBindingKey() {
    KeyAuthenticationProperties props = load(KeyAuthenticationProperties.class,
            "management.shell.auth.key.path=~/.ssh/test.pem");
    Properties p = new Properties();
    props.applyToCrshShellConfig(p);
    assertThat(p.get("crash.auth.key.path")).isEqualTo("~/.ssh/test.pem");
}
项目:spring-boot-concourse    文件:ShellPropertiesTests.java   
@Test
public void testBindingKeyIgnored() {
    KeyAuthenticationProperties props = load(KeyAuthenticationProperties.class);
    Properties p = new Properties();
    props.applyToCrshShellConfig(p);
    assertThat(p.get("crash.auth.key.path")).isNull();
}
项目:contestparser    文件:ShellPropertiesTests.java   
@Test
public void testBindingKey() {
    KeyAuthenticationProperties props = new KeyAuthenticationProperties();
    RelaxedDataBinder binder = new RelaxedDataBinder(props, "shell.auth.key");
    binder.setConversionService(new DefaultConversionService());
    Map<String, String> map = new HashMap<String, String>();
    map.put("shell.auth.key.path", "~/.ssh/test.pem");
    binder.bind(new MutablePropertyValues(map));
    assertFalse(binder.getBindingResult().hasErrors());

    Properties p = new Properties();
    props.applyToCrshShellConfig(p);

    assertEquals("~/.ssh/test.pem", p.get("crash.auth.key.path"));
}
项目:contestparser    文件:ShellPropertiesTests.java   
@Test
public void testBindingKeyIgnored() {
    KeyAuthenticationProperties props = new KeyAuthenticationProperties();
    RelaxedDataBinder binder = new RelaxedDataBinder(props, "shell.auth.key");
    binder.setConversionService(new DefaultConversionService());
    Map<String, String> map = new HashMap<String, String>();
    binder.bind(new MutablePropertyValues(map));
    assertFalse(binder.getBindingResult().hasErrors());

    Properties p = new Properties();
    props.applyToCrshShellConfig(p);

    assertNull(p.get("crash.auth.key.path"));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:CrshAutoConfiguration.java   
@Bean
@ConditionalOnProperty(prefix = AUTH_PREFIX, name = "type", havingValue = "key")
@ConditionalOnMissingBean(CrshShellAuthenticationProperties.class)
public KeyAuthenticationProperties keyAuthenticationProperties() {
    return new KeyAuthenticationProperties();
}
项目:spring-boot-concourse    文件:CrshAutoConfiguration.java   
@Bean
@ConditionalOnProperty(prefix = AUTH_PREFIX, name = "type", havingValue = "key")
@ConditionalOnMissingBean(CrshShellAuthenticationProperties.class)
public KeyAuthenticationProperties keyAuthenticationProperties() {
    return new KeyAuthenticationProperties();
}
项目:contestparser    文件:CrshAutoConfiguration.java   
@Bean
@ConditionalOnProperty(prefix = "shell", name = "auth", havingValue = "key")
@ConditionalOnMissingBean(CrshShellAuthenticationProperties.class)
public KeyAuthenticationProperties keyAuthenticationProperties() {
    return new KeyAuthenticationProperties();
}