Package org.springframework.mock.env

Examples of org.springframework.mock.env.MockEnvironment


    }
  }

  @Test
  public void testDisabledPlugins() throws Exception {
    MockEnvironment env = new MockEnvironment();
    env.setProperty("shell.disabled_plugins",
        "GroovyREPL, termIOHandler, org.crsh.auth.AuthenticationPlugin");
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setEnvironment(env);
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();
View Full Code Here


    assertEquals(this.context.getBeanFactory(), attributes.get("spring.beanfactory"));
  }

  @Test
  public void testSshConfiguration() {
    MockEnvironment env = new MockEnvironment();
    env.setProperty("shell.ssh.enabled", "true");
    env.setProperty("shell.ssh.port", "3333");
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setEnvironment(env);
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();
View Full Code Here

    assertEquals("3333", lifeCycle.getConfig().getProperty("crash.ssh.port"));
  }

  @Test
  public void testSshConfigurationWithKeyPath() {
    MockEnvironment env = new MockEnvironment();
    env.setProperty("shell.ssh.enabled", "true");
    env.setProperty("shell.ssh.key_path", "~/.ssh/id.pem");
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setEnvironment(env);
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();
View Full Code Here

    assertEquals(3, count);
  }

  @Test
  public void testDefaultAuthenticationProvider() {
    MockEnvironment env = new MockEnvironment();
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setEnvironment(env);
    this.context.setServletContext(new MockServletContext());
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();
View Full Code Here

    assertEquals("simple", lifeCycle.getConfig().get("crash.auth"));
  }

  @Test
  public void testJaasAuthenticationProvider() {
    MockEnvironment env = new MockEnvironment();
    env.setProperty("shell.auth", "jaas");
    env.setProperty("shell.auth.jaas.domain", "my-test-domain");
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setEnvironment(env);
    this.context.setServletContext(new MockServletContext());
    this.context.register(SecurityConfiguration.class);
    this.context.register(CrshAutoConfiguration.class);
View Full Code Here

        .get("crash.auth.jaas.domain"));
  }

  @Test
  public void testKeyAuthenticationProvider() {
    MockEnvironment env = new MockEnvironment();
    env.setProperty("shell.auth", "key");
    env.setProperty("shell.auth.key.path", "~/test.pem");
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setEnvironment(env);
    this.context.setServletContext(new MockServletContext());
    this.context.register(SecurityConfiguration.class);
    this.context.register(CrshAutoConfiguration.class);
View Full Code Here

    assertEquals("~/test.pem", lifeCycle.getConfig().get("crash.auth.key.path"));
  }

  @Test
  public void testSimpleAuthenticationProvider() throws Exception {
    MockEnvironment env = new MockEnvironment();
    env.setProperty("shell.auth", "simple");
    env.setProperty("shell.auth.simple.user.name", "user");
    env.setProperty("shell.auth.simple.user.password", "password");
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setEnvironment(env);
    this.context.setServletContext(new MockServletContext());
    this.context.register(SecurityConfiguration.class);
    this.context.register(CrshAutoConfiguration.class);
View Full Code Here

        "password"));
  }

  @Test
  public void testSpringAuthenticationProvider() throws Exception {
    MockEnvironment env = new MockEnvironment();
    env.setProperty("shell.auth", "spring");
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setEnvironment(env);
    this.context.setServletContext(new MockServletContext());
    this.context.register(SecurityConfiguration.class);
    this.context.register(CrshAutoConfiguration.class);
View Full Code Here

TOP

Related Classes of org.springframework.mock.env.MockEnvironment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.