本文整理匯總了Java中org.springframework.boot.actuate.autoconfigure.ShellProperties.KeyAuthenticationProperties.applyToCrshShellConfig方法的典型用法代碼示例。如果您正苦於以下問題:Java KeyAuthenticationProperties.applyToCrshShellConfig方法的具體用法?Java KeyAuthenticationProperties.applyToCrshShellConfig怎麽用?Java KeyAuthenticationProperties.applyToCrshShellConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.boot.actuate.autoconfigure.ShellProperties.KeyAuthenticationProperties
的用法示例。
在下文中一共展示了KeyAuthenticationProperties.applyToCrshShellConfig方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testBindingKey
import org.springframework.boot.actuate.autoconfigure.ShellProperties.KeyAuthenticationProperties; //導入方法依賴的package包/類
@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");
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:9,代碼來源:ShellPropertiesTests.java
示例2: testBindingKeyIgnored
import org.springframework.boot.actuate.autoconfigure.ShellProperties.KeyAuthenticationProperties; //導入方法依賴的package包/類
@Test
public void testBindingKeyIgnored() {
KeyAuthenticationProperties props = load(KeyAuthenticationProperties.class);
Properties p = new Properties();
props.applyToCrshShellConfig(p);
assertThat(p.get("crash.auth.key.path")).isNull();
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:8,代碼來源:ShellPropertiesTests.java
示例3: testBindingKey
import org.springframework.boot.actuate.autoconfigure.ShellProperties.KeyAuthenticationProperties; //導入方法依賴的package包/類
@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"));
}
示例4: testBindingKeyIgnored
import org.springframework.boot.actuate.autoconfigure.ShellProperties.KeyAuthenticationProperties; //導入方法依賴的package包/類
@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"));
}