DataSourceTypeToAwsUnit { public static String getUnit(DataSourceType dataSourceType) { switch (dataSourceType) { case COUNTER: return StandardUnit.CountSecond.toString(); case GAUGE: return StandardUnit.None.toString(); case INFORMATIONAL: return StandardUnit.None.toString(); default: return StandardUnit.None.toString(); } } private  DataSourceTypeToAwsUnit(); static String getUnit(DataSourceType dataSourceType);  }
@Test public void testGetUnit() throws Exception { String cs = "Count/Second"; String none = "None"; String val = DataSourceTypeToAwsUnit.getUnit(DataSourceType.COUNTER); assertEquals(val, cs); val = DataSourceTypeToAwsUnit.getUnit(DataSourceType.GAUGE); assertEquals(val, none); val = DataSourceTypeToAwsUnit.getUnit(DataSourceType.INFORMATIONAL); assertEquals(val, none); }