We are trying to create some integration tests based on your test module (blc-integration) but we have a problem.
In effect, we would like to write a test for our custom customers (BusinessCustomer and ConsumerCustomer) but we have 2 custom entities that extends the blc customer (see this post viewtopic.php?f=13&t=761).
So we can't declare an entity override in the applicationContext-entity.
If we write a test (eg : for a ConsumerCustomer) :
Code: Select all
@Test(dependsOnGroups = "createCustomerIdGeneration", dataProvider = "setupMyCustomers", dataProviderClass = MyCustomerDataProvider.class)
@Rollback(false)
public void createConsumerCustomer(ConsumerCustomer customerInfo) {
ConsumerCustomer customer = (ConsumerCustomer) customerService.createCustomerFromId(null);
customer.setPassword(customerInfo.getPassword());
customer.setUsername(customerInfo.getUsername());
Long customerId = customer.getId();
assertThat(customerId).isNotNull();
customer = (ConsumerCustomer) customerService
.saveCustomer(customer);
assertThat(customerId).isEqualTo(customerId);
}
There is an error :
Code: Select all
java.lang.ClassCastException: org.broadleafcommerce.profile.core.domain.CustomerImpl cannot be cast to my.company.core.profile.domain.ConsumerCustomer
Do you have an idea?
Thanks in advance