QueryDslCustomerRepository implements CustomerRepository { @Override @Transactional(readOnly = true) public List<Customer> findAll() { SQLQuery allCustomersQuery = qdslTemplate.newSqlQuery().from(qCustomer) .leftJoin(qCustomer._addressCustomerRef, qAddress); return qdslTemplate.query(allCustomersQuery, new CustomerListExtractor(), customerAddressProjection); }  @Autowired void setDataSource(DataSource dataSource); @Override @Transactional(readOnly = true) Customer findById(Long id); @Override @Transactional(readOnly = true) List<Customer> findAll(); @Override @Transactional(readOnly = true) Customer findByEmailAddress(EmailAddress emailAddress); @Override void save(final Customer customer); @Override void delete(final Customer customer);  }
@Test public void testFindAll() { List<Customer> results = repository.findAll(); assertThat(results, is(notNullValue())); assertThat(results, hasSize(3)); assertThat(results.get(0), notNullValue()); assertThat(results.get(1), notNullValue()); assertThat(results.get(2), notNullValue()); }