Package edu.drexel.goodwin.cpd.dto

Examples of edu.drexel.goodwin.cpd.dto.ContactRequest


  }

  @Test
  public void testHandleContactRequest() {
    String subject = "test subject";
    ContactRequest contact = new ContactRequest();
    contact.setSubject(subject);
    String message = "message text";
    contact.setUserMessage(message);
    String fromEmail = "userEmail";
    contact.setFromEmail(fromEmail);
    String loggedInUserInfo = "loggedInUserInfo";
    contact.setLoggedInUserInfo(loggedInUserInfo);
    BindingResult result = new BeanPropertyBindingResult(contact, "contactRequest");
   
    messageSender.handleContactRequest(contact, result);

    SimpleMailMessage sentMessage = mailSender.getMostRecentlySentMessage();
View Full Code Here


 
  @Test
  public void testContactRequestSendingDoesNotChangeFromAddressForSendMessage() throws Exception {
    // First, send contact request
    String subject = "test subject";
    ContactRequest contact = new ContactRequest();
    contact.setSubject(subject);
    String message = "message text";
    contact.setUserMessage(message);
    String contactRequestFromEmail = "userEmail";
    contact.setFromEmail(contactRequestFromEmail);
    String loggedInUserInfo = "loggedInUserInfo";
    contact.setLoggedInUserInfo(loggedInUserInfo);
    BindingResult result = new BeanPropertyBindingResult(contact, "contactRequest");
   
    messageSender.handleContactRequest(contact, result);
   
    SimpleMailMessage sentContactRequestMessage = mailSender.getMostRecentlySentMessage();
View Full Code Here

    return "contact/complete";
  }

  @RequestMapping(value = "/contact", method = RequestMethod.GET)
  public String createForm(ModelMap modelMap) {
    ContactRequest contact = new ContactRequest();

    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
   
    Collection<GrantedAuthority> authorities = authentication.getAuthorities();
    for (GrantedAuthority auth : authorities) {
      if ("ROLE_ANONYMOUS".equals(auth.getAuthority())) {
       
      }
    }
    if(!"anonymousUser".equals(authentication.getName())) {
      String currentlyLoggedInReseacher = ((Researcher) authentication.getPrincipal()).getUsername();
      contact.setFromEmail(currentlyLoggedInReseacher);
    }

    modelMap.addAttribute("contact", contact);
    modelMap.addAttribute("subjects", ContactUsSubject.findAllContactUsSubjects());
    return "contact/form";
View Full Code Here

TOP

Related Classes of edu.drexel.goodwin.cpd.dto.ContactRequest

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.