@@ -0,0 +1,1496 @@
+package com.nitorcreations.willow.servers;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.util.Collection;%0Aimport java.util.HashSet;%0Aimport java.util.LinkedHashSet;%0A%0Aimport org.junit.Test;%0A%0Aimport com.nitorcreations.willow.messages.HostInfoMessage;%0Aimport com.nitorcreations.willow.messages.metrics.MetricConfig;%0Aimport com.nitorcreations.willow.metrics.HostInfoMetric;%0A%0A%0Apublic class HostInfoHostLookupServiceTest %7B%0A  public static class DummyHostInfoMetric extends HostInfoMetric %7B%0A    @Override%0A    public Collection%3CHostInfoMessage%3E calculateMetric(MetricConfig conf) %7B%0A      HashSet%3CHostInfoMessage%3E ret = new LinkedHashSet%3C%3E();%0A      HostInfoMessage testVal = new HostInfoMessage();%0A      testVal.setInstance(%22foo%22);%0A      testVal.username = %22foo%22;%0A      testVal.privateHostname = %22foo-host%22;%0A      ret.add(testVal);%0A      testVal = new HostInfoMessage();%0A      testVal.setInstance(%22test%22);%0A      testVal.username = %22admin%22;%0A      testVal.privateHostname = %22test-host%22;%0A      ret.add(testVal);%0A      return ret;%0A    %7D      %0A  %7D%0A  public HostInfoHostLookupService test = new HostInfoHostLookupService();%0A  public HostInfoHostLookupServiceTest() %7B%0A    test.hostInfoMetric = new DummyHostInfoMetric();%0A  %7D%0A  @Test%0A  public void testAdminUser() %7B%0A    assertEquals(%22Test should return 'admin'%22, %22admin%22, test.getAdminUserFor(%22test%22));%0A  %7D%0A  @Test%0A  public void testGetResolvableHostname() %7B%0A    assertEquals(%22Test should return 'admin'%22, %22test-host%22, test.getResolvableHostname(%22test%22));%0A  %7D%0A%7D%0A

Add test class