Parser implements IParser { @Override public ParsedInfo parse() throws APIRestGeneratorException { final ParsedInfo parsedInfo = new ParsedInfo() ; final JsonNode fileContent = ParserUtil.deserializeIntoJson(this.filePath) ; final RootValues rootValues = this.parseRootValues(fileContent) ; parsedInfo.setRootValues(rootValues) ; final InfoValues infoValues = this.parseInfoValues(fileContent) ; parsedInfo.setInfoValues(infoValues) ; final Definitions definitions = this.parseDefinitions(fileContent) ; parsedInfo.setDefinitions(definitions) ; final ParametersGlobal parametersGlobal = this.parseParameters(fileContent, rootValues, definitions) ; parsedInfo.setParametersGlobal(parametersGlobal) ; final Responses responses = this.parseResponses(fileContent, definitions) ; parsedInfo.setResponses(responses) ; final Paths paths = this.parsePaths(fileContent, rootValues, definitions, parametersGlobal, responses) ; parsedInfo.setPaths(paths) ; final GeneratorParams generatorParams = this.parseGeneratorParams(fileContent) ; parsedInfo.setGeneratorParams(generatorParams) ; if (Parser.LOGGER.isDebugEnabled()) { Parser.LOGGER.debug(parsedInfo.toString()) ; } return parsedInfo ; } Parser(final String filePath); @Override ParsedInfo parse(); @Override String getParserProjectInfo();  }
@Test(expected = APIRestGeneratorException.class) public void invalidDuplicatedResponseCodes() throws APIRestGeneratorException { IParser parser = new Parser(YAML_INVALID_DUPL_RESP_CODE) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidNoReferencedResponsesDefined() throws APIRestGeneratorException { IParser parser = new Parser(YAML_INVALID_NO_REF_RES_DEF) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidRegularExpressionResponse() throws APIRestGeneratorException { IParser parser = new Parser(YAML_INVALID_REG_EXP_RESPON) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidNoResponse200() throws APIRestGeneratorException { IParser parser = new Parser(YAML_INVALID_NO_RESP_200) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidResponseArrayOfFiles() throws APIRestGeneratorException { IParser parser = new Parser(YAML_INVALID_RES_ARR_OF_FIL) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidDuplicatedOperationId() throws APIRestGeneratorException { IParser parser = new Parser(YAML_INVALID_DUPL_OPERAT_ID) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidTestNoTypeNoRefDefinition() throws APIRestGeneratorException { IParser parser = new Parser(YAML_NOTYPE_NOREF_DEFINIT) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidTestNoTypeObjectDefinition() throws APIRestGeneratorException { IParser parser = new Parser(YAML_NOTYPE_OBJECT_DEFINIT) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidUuaa() throws APIRestGeneratorException { IParser parser = new Parser(YAML_INVALID_UUAA) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidInValue() throws APIRestGeneratorException { IParser parser = new Parser(YAML_INVALID_IN_VALUE) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidNoExpectedRefParameter() throws APIRestGeneratorException { IParser parser = new Parser(YAML_INVALID_NO_EXP_REF_PAR) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidPathValue() throws APIRestGeneratorException { IParser parser = new Parser(YAML_INVALID_PATH_VALUE) ; parser.parse() ; }
@Test(expected = APIRestGeneratorException.class) public void invalidNoTypeForArrayResponse() throws APIRestGeneratorException { IParser parser = new Parser(YAML_INVALID_NO_TYPE_ARR_RE) ; parser.parse() ; }