@Test
public void testIsValidServiceNameCreationWithGreater255Characters() throws Exception{

	String serviceName = "c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1_yarn_c1";
	ValidationErrorCode vErrCod = ValidationErrorCode.SERVICE_VALIDATION_ERR_SPECIAL_CHARACTERS_SERVICE_NAME;
	String errorMessage         = vErrCod.getMessage(serviceName);
	int errorCode               = vErrCod.getErrorCode();
	RangerService rangerService = new RangerService();
	rangerService.setName(serviceName);
	rangerService.setType("yarn");
	rangerService.setTagService("");
	RangerServiceConfigDef configDef = new RangerServiceConfigDef();
	configDef.setMandatory(true);
	
	List<RangerServiceConfigDef> listRangerServiceConfigDef = new ArrayList<RangerServiceDef.RangerServiceConfigDef>();
	listRangerServiceConfigDef.add(configDef);
	
	
	configDef.setName("myconfig1");
	
	Map<String,String> testMap = new HashMap<String, String>();
	testMap.put("myconfig1", "myconfig1");
	
	rangerService.setConfigs(testMap);
	
	
	RangerServiceDef rangerServiceDef = new RangerServiceDef();
	rangerServiceDef.setConfigs(listRangerServiceConfigDef);
	
	when(_store.getServiceDefByName("yarn")).thenReturn(rangerServiceDef);
	boolean  valid = _validator.isValid(rangerService, _action, _failures);
	ValidationFailureDetails failureMessage = _failures.get(0);
	Assert.assertFalse(valid);
	Assert.assertEquals("name",failureMessage.getFieldName());
	Assert.assertEquals(errorMessage, failureMessage._reason);
	Assert.assertEquals(errorCode, failureMessage._errorCode);
}