@Test
public final void test_isValidName_create() throws Exception {

	Long id = null; // id should be irrelevant for name check for create.
	// for create a service shouldn't exist with the name
	String name = "existing-service";
	when(_serviceDef.getName()).thenReturn(name);
	when(_store.getServiceDefByName(name)).thenReturn(null);
	assertTrue(_validator.isValidServiceDefName(name, id, Action.CREATE, _failures));
	assertTrue(_failures.isEmpty());
	
	RangerServiceDef existingServiceDef = mock(RangerServiceDef.class);
	when(_store.getServiceDefByName(name)).thenReturn(existingServiceDef);
	_failures.clear(); assertFalse(_validator.isValidServiceDefName(name, id, Action.CREATE, _failures));
	_utils.checkFailureForSemanticError(_failures, "name");
}