forked from loafle/openapi-generator-original
Typescript fetch fork (#569)
* added my fork from https://github.com/Place1/swagger-codegen-typescript-browser * ran bin/typescript-fetch-petstore-all.sh * use FormData.append rather than .set for IE11 compat * reverted change to licenseInfo.mustache * reverted some comments * added package.json and tsconfig.json back to the generator * added support for blob (application/octet-stream) responses * models and apis are now in folders * added support for modelPropertyNaming based on the spec * bug fix * updated samples * Restore pom.xml for typescript project * Restore samples/client/petstore/typescript-fetch/tests/default/package.json ≈ * added support for response type Date conversion * updated samples * Rework pom in "samples.ci" * Restore "samples/client/petstore/typescript-fetch/tests/default" * updated configuration class to use property getters to allow clients to implement configuration values as getters * added {{datatype}}ToJSON functions to handle serialization and naming conversions * fixed missing import * fixed compilation error. updated samples * 1 character change to get CI to run again * updated samples * added support for array type request body * updated tests * support for optional request bodies * updated models json converters to handle undefined inputs (to simplify usage in optional contexts like optional request bodies) * updated samples * updated tests * changed to typescript version 2.4 * updated samples * support for optional properties being null, undefined or omitted * updated samples * bug fix * bug fix * updated samples * ran npm install in test project * patch to get tests running * added support for retrieving raw response. added support for binary request bodies. added support for blob data type for files/binary.
This commit is contained in:
34
modules/openapi-generator-gradle-plugin/bin/test/TestBase.kt
Normal file
34
modules/openapi-generator-gradle-plugin/bin/test/TestBase.kt
Normal file
@@ -0,0 +1,34 @@
|
||||
package org.openapitools.generator.gradle.plugin
|
||||
|
||||
import org.testng.annotations.AfterMethod
|
||||
import org.testng.annotations.BeforeMethod
|
||||
import java.io.File
|
||||
import java.io.InputStream
|
||||
|
||||
abstract class TestBase {
|
||||
protected open lateinit var temp: File
|
||||
|
||||
@BeforeMethod
|
||||
protected fun before() {
|
||||
temp = createTempDir(javaClass.simpleName)
|
||||
temp.deleteOnExit()
|
||||
}
|
||||
|
||||
@AfterMethod
|
||||
protected fun after(){
|
||||
temp.deleteRecursively()
|
||||
}
|
||||
|
||||
protected fun withProject(
|
||||
buildContents: String,
|
||||
projectFiles: Map<String, InputStream> = mapOf()
|
||||
) {
|
||||
val buildFile = File(temp,"build.gradle")
|
||||
buildFile.writeText(buildContents)
|
||||
|
||||
projectFiles.forEach { entry ->
|
||||
val target = File(temp, entry.key)
|
||||
entry.value.copyTo(target.outputStream())
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user