Package org.kuali.rice.core.api.config.property

Examples of org.kuali.rice.core.api.config.property.ConfigurationService


  @Test
  /**
   * Test method for {@link org.martinlaw.auth. OpenIDSuccessAuthenticationSuccessHandler#emailSetupOk()}
   */
  public void testEmailSetupOk() throws IOException {
    ConfigurationService cfgSvc = mock(ConfigurationService.class);
    when(cfgSvc.getPropertyValueAsString(anyString())).thenReturn("");
    OpenIDSuccessAuthenticationSuccessHandler successHander = new OpenIDSuccessAuthenticationSuccessHandler();
    successHander.setConfigurationService(cfgSvc);
    assertFalse("no email config params exist", successHander.emailSetupOk());
    when(cfgSvc.getPropertyValueAsString(MartinlawConstants.EmailParameters.HOST_PROPERTY)).thenReturn("host");
    assertFalse("not all email config params exist", successHander.emailSetupOk());
    when(cfgSvc.getPropertyValueAsString(MartinlawConstants.EmailParameters.PORT_PROPERTY)).thenReturn("port");
    assertTrue("all email config params exist", successHander.emailSetupOk());
  }
View Full Code Here


    assertEquals("account inactive", expected, successHandler.getActivationMessage());
   
    entity.setActive(true);
   
    // simulate that email configs and other properties are present are ok
    ConfigurationService cfgSvc = mock(ConfigurationService.class);
    when(cfgSvc.getPropertyValueAsString(anyString())).thenReturn("niko");
    final String sendingEmail = "mlaw.unt@mlaw.co.ke";
    when(cfgSvc.getPropertyValueAsString(MartinlawConstants.EmailParameters.USERNAME_PROPERTY)).thenReturn(sendingEmail);
    successHandler.setConfigurationService(cfgSvc);
    // provide a mock mailer object
    Mailer mailer = mock(Mailer.class);
    successHandler.setMailer(mailer);
    // mock the identity service - near impossible since it returns 'final' objects, which are not mockito-able
View Full Code Here

TOP

Related Classes of org.kuali.rice.core.api.config.property.ConfigurationService

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.