### Question:
AlertDefinitionDAO { @RequiresSession public List<AlertDefinitionEntity> findByServiceComponent(long clusterId, String serviceName, String componentName) { if (null == serviceName || null == componentName) { return Collections.emptyList(); } TypedQuery<AlertDefinitionEntity> query = entityManagerProvider.get().createNamedQuery( "AlertDefinitionEntity.findByServiceAndComponent", AlertDefinitionEntity.class); query.setParameter("clusterId", clusterId); query.setParameter("serviceName", serviceName); query.setParameter("componentName", componentName); return daoUtils.selectList(query); }  @RequiresSession AlertDefinitionEntity findById(long definitionId); @RequiresSession AlertDefinitionEntity findByName(long clusterId, String definitionName); @RequiresSession List<AlertDefinitionEntity> findAll(); @RequiresSession List<AlertDefinitionEntity> findAll(long clusterId); @RequiresSession List<AlertDefinitionEntity> findAllEnabled(long clusterId); @RequiresSession List<AlertDefinitionEntity> findByIds(List<Long> definitionIds); @RequiresSession List<AlertDefinitionEntity> findByService(long clusterId,
      String serviceName); @RequiresSession List<AlertDefinitionEntity> findByServiceMaster(long clusterId,
      Set<String> services); @RequiresSession List<AlertDefinitionEntity> findByServiceComponent(long clusterId,
      String serviceName, String componentName); @RequiresSession List<AlertDefinitionEntity> findAgentScoped(long clusterId); @RequiresSession List<AlertDefinitionEntity> findBySourceType(Long clusterId, SourceType sourceType); @Transactional void create(AlertDefinitionEntity alertDefinition); @Transactional void refresh(AlertDefinitionEntity alertDefinition); @Transactional AlertDefinitionEntity merge(AlertDefinitionEntity alertDefinition); void createOrUpdate(AlertDefinitionEntity alertDefinition); @Transactional void remove(AlertDefinitionEntity alertDefinition); @Transactional void removeAll(long clusterId);  }### Answer:
@Test public void testFindByServiceComponent() { List<AlertDefinitionEntity> definitions = dao.findByServiceComponent( clusterId, "OOZIE", "OOZIE_SERVER"); assertNotNull(definitions); assertEquals(2, definitions.size()); }