GeneratedOutputAttachmentHandler { static Tag[] tagsForRequest(GeneratorPluginConfiguration plugin, Map<String, String> requestParams) { Tag[] tags = requestParams.values() .stream() .map(Tag::new) .collect(Collectors.toList()) .toArray(new Tag[requestParams.size() + 2]); tags[tags.length - 1] = new Tag(plugin.getKey() + '_' + plugin.getPluginVersion()); tags[tags.length - 2] = new Tag("generated"); return tags; } @Autowired  GeneratedOutputAttachmentHandler(IModelRepositoryFactory modelRepositoryFactory);   }
@Test public void tagsForRequest() { GeneratorPluginConfiguration plugin = GeneratorPluginConfiguration .of("eclipseditto", "v2", "http: Map<String, String> requestParams = new HashMap<>(); requestParams.put("target", "thingJson"); requestParams.put("anotherParam", "test"); Tag[] result = GeneratedOutputAttachmentHandler.tagsForRequest(plugin, requestParams); assertNotNull(result); assertTrue(Arrays.asList(result).contains(new Tag("test"))); assertTrue(Arrays.asList(result).contains(new Tag("thingJson"))); assertTrue(Arrays.asList(result).contains(new Tag("generated"))); assertTrue(Arrays.asList(result).contains(new Tag("eclipseditto_1.0.0"))); }