@Test
public void testFindAll() {

  BlueprintEntity entity = new BlueprintEntity();
  TypedQuery<BlueprintEntity> query = createStrictMock(TypedQuery.class);
  // set expectations
  expect(entityManager.createNamedQuery(eq("allBlueprints"), eq(BlueprintEntity.class))).andReturn(query);
  expect(query.getResultList()).andReturn(Collections.singletonList(entity));
  replay(entityManager, query);
  BlueprintDAO dao = new BlueprintDAO();
  dao.entityManagerProvider = entityManagerProvider;
  List<BlueprintEntity> results = dao.findAll();
  assertEquals(1, results.size());
  assertSame(entity, results.get(0));
  verify(entityManagerProvider, entityManager, query);
}