@Test
public void testGroupByTagNoFunction() {

	Transform transform = new GroupByTagTransform(new TransformFactory(null, null));
	Map<Long, Double> datapoints = new HashMap<Long, Double>();
	datapoints.put(1000L, 1.0);
	List<Metric> metrics = new ArrayList<>();
	Metric metric1 = new Metric("scope", "latency");
	metric1.setTag("device", "device1");
	metric1.setDatapoints(datapoints);
	Metric metric2 = new Metric("scope", "latency");
	metric2.setTag("device", "device2");
	metric2.setDatapoints(datapoints);
	metrics.add(metric1);
	metrics.add(metric2);
	List<String> constants = new ArrayList<>();
	constants.add("device");
	constants.add("union");
	try {
		List<Metric> result = transform.transform(null, metrics, constants);
		fail("Should fail because no function is provided");
	}
	catch (UnsupportedOperationException ex) {
		assertTrue(ex.getMessage().contains("function name to be provided"));
	}
}