Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CORE]: replace deprecated methods #7600

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private static String generate(String language, GeneratorInput opts, Type type)

codegenConfig.setOutputDir(outputFolder);

clientOptInput.setConfig(codegenConfig);
clientOptInput.config(codegenConfig);

try {
List<File> files = new DefaultGenerator().opts(clientOptInput).generate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ public void testNonStrictProcessPaths() throws Exception {
openAPI.getPaths().addPathItem("path2/", new PathItem().get(new Operation().operationId("op2").addParametersItem(new QueryParameter().name("p1").schema(new StringSchema())).responses(new ApiResponses().addApiResponse("201", new ApiResponse().description("OK")))));

ClientOptInput opts = new ClientOptInput();
opts.setOpenAPI(openAPI);
opts.openAPI(openAPI);
CodegenConfig config = new DefaultCodegen();
config.setStrictSpecBehavior(false);
opts.setConfig(config);
opts.config(config);

DefaultGenerator generator = new DefaultGenerator();
generator.opts(opts);
Expand All @@ -372,8 +372,8 @@ public void testProcessPaths() throws Exception {
openAPI.getPaths().addPathItem("/path4", new PathItem().addParametersItem(new QueryParameter().name("p1").schema(new StringSchema())).get(new Operation().operationId("op4").responses(new ApiResponses().addApiResponse("201", new ApiResponse().description("OK")))));

ClientOptInput opts = new ClientOptInput();
opts.setOpenAPI(openAPI);
opts.setConfig(new DefaultCodegen());
opts.openAPI(openAPI);
opts.config(new DefaultCodegen());

DefaultGenerator generator = new DefaultGenerator();
generator.opts(opts);
Expand All @@ -395,10 +395,10 @@ public void testProcessPaths() throws Exception {
public void testRefModelValidationProperties() {
OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/refAliasedPrimitiveWithValidation.yml");
ClientOptInput opts = new ClientOptInput();
opts.setOpenAPI(openAPI);
opts.openAPI(openAPI);
DefaultCodegen config = new DefaultCodegen();
config.setStrictSpecBehavior(false);
opts.setConfig(config);
opts.config(config);

DefaultGenerator generator = new DefaultGenerator();
generator.opts(opts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public void testGenerateRootEndpoint() throws IOException {
.getOpenAPI();

ClientOptInput input = new ClientOptInput();
input.setOpenAPI(openAPI);
input.setConfig(codegen);
input.openAPI(openAPI);
input.config(codegen);

// when
DefaultGenerator generator = new DefaultGenerator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ public void testAuthorizationScopeValues_Issue392() {
final DefaultGenerator defaultGenerator = new DefaultGenerator();

final ClientOptInput clientOptInput = new ClientOptInput();
clientOptInput.setOpenAPI(openAPI);
clientOptInput.setConfig(new JavaClientCodegen());
clientOptInput.openAPI(openAPI);
clientOptInput.config(new JavaClientCodegen());

defaultGenerator.opts(clientOptInput);
final List<CodegenOperation> codegenOperations = defaultGenerator.processPaths(openAPI.getPaths()).get("Pet");
Expand Down Expand Up @@ -541,8 +541,8 @@ public void testAuthorizationsHasMoreWhenFiltered() {
final DefaultGenerator defaultGenerator = new DefaultGenerator();

final ClientOptInput clientOptInput = new ClientOptInput();
clientOptInput.setOpenAPI(openAPI);
clientOptInput.setConfig(new JavaClientCodegen());
clientOptInput.openAPI(openAPI);
clientOptInput.config(new JavaClientCodegen());

defaultGenerator.opts(clientOptInput);
final List<CodegenOperation> codegenOperations = defaultGenerator.processPaths(openAPI.getPaths()).get("Pet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,8 @@ public void generateEmpty() throws Exception {
final OpenAPI openAPI = TestUtils.parseFlattenSpec(inputSpec);

final ClientOptInput opts = new ClientOptInput();
opts.setConfig(config);
opts.setOpenAPI(openAPI);
opts.config(config);
opts.openAPI(openAPI);
new DefaultGenerator().opts(opts).generate();

File orderFile = new File(output, "src/main/java/org/openapitools/client/api/DefaultApi.java");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ public void testGenerateOperationBodyWithCodedTestData() throws Exception {
codegen.additionalProperties().put(CXFExtServerFeatures.GENERATE_OPERATION_BODY, "true");

ClientOptInput input = new ClientOptInput();
input.setOpenAPI(openAPI);
input.setConfig(codegen);
input.openAPI(openAPI);
input.config(codegen);

DefaultGenerator generator = new DefaultGenerator();
generator.opts(input).generate();
Expand Down Expand Up @@ -426,8 +426,8 @@ public void testGenerateOperationBodyWithJsonTestData() throws Exception {
codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true");

ClientOptInput input = new ClientOptInput();
input.setOpenAPI(openAPI);
input.setConfig(codegen);
input.openAPI(openAPI);
input.config(codegen);

DefaultGenerator generator = new DefaultGenerator();
generator.opts(input).generate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public void doNotGenerateRequestParamForObjectQueryParam() throws IOException {
codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true");

ClientOptInput input = new ClientOptInput();
input.setOpenAPI(openAPI);
input.setConfig(codegen);
input.openAPI(openAPI);
input.config(codegen);

DefaultGenerator generator = new DefaultGenerator();

Expand Down Expand Up @@ -255,8 +255,8 @@ public void shouldGenerateRequestParamForRefParams_3248_Regression() throws IOEx
codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true");

ClientOptInput input = new ClientOptInput();
input.setOpenAPI(openAPI);
input.setConfig(codegen);
input.openAPI(openAPI);
input.config(codegen);

DefaultGenerator generator = new DefaultGenerator();

Expand Down Expand Up @@ -287,8 +287,8 @@ public void shouldGenerateRequestParamForRefParams_3248_RegressionDates() throws
codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true");

ClientOptInput input = new ClientOptInput();
input.setOpenAPI(openAPI);
input.setConfig(codegen);
input.openAPI(openAPI);
input.config(codegen);

DefaultGenerator generator = new DefaultGenerator();

Expand Down Expand Up @@ -426,8 +426,8 @@ public void testDoGenerateRequestBodyRequiredAttribute_3134_Regression() throws
codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true");

ClientOptInput input = new ClientOptInput();
input.setOpenAPI(openAPI);
input.setConfig(codegen);
input.openAPI(openAPI);
input.config(codegen);

DefaultGenerator generator = new DefaultGenerator();

Expand Down