PriorityTagUtil { public static PRIORITY resolve(Iterable<Tag> tags) { PRIORITY v = PRIORITY.NORMAL; String value = Utils.getTagValue(tags, TAG_PRIORITY_KEY); if (value != null) { for (PRIORITY p : PRIORITY.values()) { if (p.name().equalsIgnoreCase(value)) { return p; } } } return v; } private  PriorityTagUtil(); static PRIORITY resolve(Iterable<Tag> tags);  }
@Test public void testResolveHigh() { List<Tag> tags = new ArrayList<Tag>(); tags.add(new BasicTag("k1", "v1")); tags.add(new BasicTag(TAG_PRIORITY_KEY, PRIORITY.HIGH.toString())); Assert.assertEquals(PRIORITY.HIGH, PriorityTagUtil.resolve(tags)); }
@Test public void testResolveHigh2() { List<Tag> tags = new ArrayList<Tag>(); tags.add(new BasicTag("k1", "v1")); tags.add(LookoutConstants.HIGH_PRIORITY_TAG); Assert.assertEquals(PRIORITY.HIGH, PriorityTagUtil.resolve(tags)); }
@Test public void testResolveNothing() { List<Tag> tags = new ArrayList<Tag>(); tags.add(new BasicTag("k1", "v1")); Assert.assertNotEquals(PRIORITY.HIGH, PriorityTagUtil.resolve(tags)); Assert.assertEquals(PRIORITY.NORMAL, PriorityTagUtil.resolve(tags)); }