ParameterPath extends ParameterNoBody { @Override public void validate() throws APIRestGeneratorException { super.validate() ; String errorString = null ; if (!this.isRequired()) { errorString = "The 'name' field '" + this.getName() + "' in PATH must contain a field 'required' as 'true'" ; } else if (this.getAlias() != null && !this.getAlias().equals(this.getName())) { errorString = "The 'alias' field '" + this.getAlias() + "' in PATH must be the same than the 'name' value '" + this.getName() + "'" ; } else if (this.isAutoInjected()) { errorString = "Auto Injection cannot be implemented for path parameters" ; } if (errorString != null) { ParameterPath.LOGGER.error(errorString) ; throw new APIRestGeneratorException(errorString) ; } } ParameterPath(final String name,
						 final String alias,
						 final String description,
						 final String required,
						 final String type,
						 final String autoInjected); @Override void validate(); @Override String getClassName();  }
@Test(expected = APIRestGeneratorException.class) public void invalidParameterRequiredFalse() throws APIRestGeneratorException { final ParameterPath parameterPath = new ParameterPath(ConstantsTest.NAME, ConstantsTest.ALIAS, ConstantsTest.DESCRIPTION, "false", ConstantsTest.TYPE, ConstantsTest.AUTO_INJECTED) ; parameterPath.validate() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidParameterAliasNotEqualsName() throws APIRestGeneratorException { final ParameterPath parameterPath = new ParameterPath(ConstantsTest.NAME, "differentValueThanName", ConstantsTest.DESCRIPTION, ConstantsTest.REQUIRED, ConstantsTest.TYPE, ConstantsTest.AUTO_INJECTED) ; parameterPath.validate() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidParameterPathAutoinjectedTrue() throws APIRestGeneratorException { final ParameterPath parameterPath = new ParameterPath(ConstantsTest.NAME, ConstantsTest.ALIAS, ConstantsTest.DESCRIPTION, ConstantsTest.REQUIRED, ConstantsTest.TYPE, "true") ; parameterPath.validate() ; }