### Question:
MetadataDao extends NamedParameterJdbcDaoSupport { public List<MetadataEntryWithIssuesCount> loadMetadataItemsWithIssues(List<EntityVO> entities) { List<MetadataEntryWithIssuesCount> items = getNamedParameterJdbcTemplate() .query(convertEntitiesToString(loadMetadataItemsWithIssuesQuery, entities), MetadataParameters.getParametersWithArrays(entities), MetadataParameters.getRowMapperWithIssues()); return items.isEmpty() ? null : items; }  @Transactional(propagation = Propagation.MANDATORY) void registerMetadataItem(MetadataEntry metadataEntry); @Transactional(propagation = Propagation.MANDATORY) void uploadMetadataItemKey(EntityVO entityVO, String key, String value, String type); @Transactional(propagation = Propagation.MANDATORY) void uploadMetadataItem(MetadataEntry metadataEntry); @Transactional(propagation = Propagation.MANDATORY) void deleteMetadataItem(EntityVO entityVO); @Transactional(propagation = Propagation.MANDATORY) void deleteMetadataItemKey(EntityVO entityVO, String key); @Transactional(propagation = Propagation.MANDATORY) MetadataEntry deleteMetadataItemKeys(MetadataEntry metadataEntry, Set<String> keysToDelete); List<String> loadUniqueValuesFromEntitiesAttribute(final AclClass entityClass, final String attributeKey); MetadataEntry loadMetadataItem(EntityVO entity); boolean hasMetadata(EntityVO entity); List<MetadataEntry> loadMetadataItems(List<EntityVO> entities); List<MetadataEntryWithIssuesCount> loadMetadataItemsWithIssues(List<EntityVO> entities); List<EntityVO> searchMetadataByClassAndKeyValue(final AclClass entityClass,
                                                           final Map<String, PipeConfValue> indicator); List<CategoricalAttribute> buildFullMetadataDict(); static String convertDataToJsonStringForQuery(Map<String, PipeConfValue> data); Set<String> loadMetadataKeys(final AclClass entityClass); @Required void setLoadMetadataItemsWithIssuesQuery(String loadMetadataItemsWithIssuesQuery); @Required void setUploadMetadataItemKeyQuery(String uploadMetadataItemKeyQuery); @Required void setLoadMetadataItemQuery(String loadMetadataItemQuery); @Required void setLoadMetadataItemsQuery(String loadMetadataItemsQuery); @Required void setCreateMetadataItemQuery(String createMetadataItemQuery); @Required void setDeleteMetadataItemQuery(String deleteMetadataItemQuery); @Required void setDeleteMetadataItemKeyQuery(String deleteMetadataItemKeyQuery); @Required void setUploadMetadataItemQuery(String uploadMetadataItemQuery); @Required void setSearchMetadataByClassAndKeyValueQuery(String searchMetadataByClassAndKeyValueQuery); @Required void setLoadUniqueValuesFromEntitiesAttributes(final String loadUniqueValuesFromEntitiesAttributes); @Required void setCreateMetadataDictionary(final String createMetadataDictionary); @Required void setLoadMetadataKeysQuery(final String loadMetadataKeysQuery);  }### Answer:
@Test public void testMetadataWithIssues() { Pair<EntityVO, MetadataEntry> pipelinePair = createItems("pipeline", AclClass.PIPELINE, true); Pair<EntityVO, MetadataEntry> folderPair = createItems("folder", AclClass.FOLDER, true); Pair<EntityVO, MetadataEntry> configurationPair = createItems("configuration", AclClass.CONFIGURATION, false); List<MetadataEntryWithIssuesCount> expectedMetadataEntries = new ArrayList<>(); expectedMetadataEntries.add( convertMetadataWithIssues(pipelinePair.getLeft(), pipelinePair.getRight().getData(), 1)); expectedMetadataEntries.add( convertMetadataWithIssues(folderPair.getLeft(), folderPair.getRight().getData(), 1)); expectedMetadataEntries.add(convertMetadataWithIssues(configurationPair.getLeft(), null, 1)); List<MetadataEntryWithIssuesCount> actualMetadataEntries = metadataDao.loadMetadataItemsWithIssues( Stream.of(pipelinePair.getLeft(), folderPair.getLeft(), configurationPair.getLeft()) .collect(Collectors.toList())); Map<EntityVO, MetadataEntry> expectedMap = expectedMetadataEntries.stream() .collect(Collectors.toMap(MetadataEntry::getEntity, Function.identity())); actualMetadataEntries.forEach(m -> Assert.assertEquals(expectedMap.get(m.getEntity()), m)); }