Search in sources :

Example 1 with ChallengeQuestion

use of org.broadleafcommerce.profile.core.domain.ChallengeQuestion in project BroadleafCommerce by BroadleafCommerce.

the class RegisterCustomerDataProvider method createCustomer.

@DataProvider(name = "setupCustomerControllerData")
public static Object[][] createCustomer() {
    Customer customer = new CustomerImpl();
    customer.setEmailAddress("testCase@test.com");
    customer.setFirstName("TestFirstName");
    customer.setLastName("TestLastName");
    customer.setUsername("TestCase");
    ChallengeQuestion question = new ChallengeQuestionImpl();
    question.setId(1L);
    customer.setChallengeQuestion(question);
    customer.setChallengeAnswer("Challenge CandidateItemOfferAnswer");
    RegisterCustomerForm registerCustomer = new RegisterCustomerForm();
    registerCustomer.setCustomer(customer);
    registerCustomer.setPassword("TestPassword");
    registerCustomer.setPasswordConfirm("TestPassword");
    return new Object[][] { new Object[] { registerCustomer } };
}
Also used : Customer(org.broadleafcommerce.profile.core.domain.Customer) ChallengeQuestionImpl(org.broadleafcommerce.profile.core.domain.ChallengeQuestionImpl) RegisterCustomerForm(org.broadleafcommerce.profile.web.core.form.RegisterCustomerForm) CustomerImpl(org.broadleafcommerce.profile.core.domain.CustomerImpl) ChallengeQuestion(org.broadleafcommerce.profile.core.domain.ChallengeQuestion) DataProvider(org.testng.annotations.DataProvider)

Example 2 with ChallengeQuestion

use of org.broadleafcommerce.profile.core.domain.ChallengeQuestion in project BroadleafCommerce by BroadleafCommerce.

the class ChallengeQuestionDaoImpl method readChallengeQuestionById.

@Override
public ChallengeQuestion readChallengeQuestionById(long challengeQuestionId) {
    Query query = em.createNamedQuery("BC_READ_CHALLENGE_QUESTION_BY_ID");
    query.setParameter("question_id", challengeQuestionId);
    List<ChallengeQuestion> challengeQuestions = query.getResultList();
    return challengeQuestions == null || challengeQuestions.isEmpty() ? null : challengeQuestions.get(0);
}
Also used : Query(javax.persistence.Query) ChallengeQuestion(org.broadleafcommerce.profile.core.domain.ChallengeQuestion)

Aggregations

ChallengeQuestion (org.broadleafcommerce.profile.core.domain.ChallengeQuestion)2 Query (javax.persistence.Query)1 ChallengeQuestionImpl (org.broadleafcommerce.profile.core.domain.ChallengeQuestionImpl)1 Customer (org.broadleafcommerce.profile.core.domain.Customer)1 CustomerImpl (org.broadleafcommerce.profile.core.domain.CustomerImpl)1 RegisterCustomerForm (org.broadleafcommerce.profile.web.core.form.RegisterCustomerForm)1 DataProvider (org.testng.annotations.DataProvider)1