diff --git a/config.yml b/config.yml index 86e9a81d..3a459afe 100644 --- a/config.yml +++ b/config.yml @@ -27,3 +27,5 @@ importMappings: globalProperties: apiTests: false modelTests: false +# When an unknown enum value is found map to unknown_default_open_api +enumUnknownDefaultCase: true diff --git a/src/test/java/ai/reveng/model/EnumUnknownDefaultTest.java b/src/test/java/ai/reveng/model/EnumUnknownDefaultTest.java new file mode 100644 index 00000000..247dc960 --- /dev/null +++ b/src/test/java/ai/reveng/model/EnumUnknownDefaultTest.java @@ -0,0 +1,22 @@ +package ai.reveng.model; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +/** + * Verifies enumUnknownDefaultCase=true: unknown enum values from the API are + * mapped to UNKNOWN_DEFAULT_OPEN_API instead of throwing, so the SDK can + * deserialize responses that introduce new enum values before the SDK is + * regenerated. + */ +public class EnumUnknownDefaultTest { + + @Test + public void unknownValueMapsToUnknownDefaultOpenApi() { + Order order = Order.fromValue("a_value_that_does_not_exist"); + + assertEquals("UNKNOWN_DEFAULT_OPEN_API", order.name()); + assertEquals("unknown_default_open_api", order.getValue()); + } +} diff --git a/src/test/java/ai/reveng/model/GetMeResponseTest.java b/src/test/java/ai/reveng/model/GetMeResponseTest.java deleted file mode 100644 index a33487da..00000000 --- a/src/test/java/ai/reveng/model/GetMeResponseTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is Similarity Search Engine for executable binaries - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for GetMeResponse - */ -public class GetMeResponseTest { - private final GetMeResponse model = new GetMeResponse(); - - /** - * Model tests for GetMeResponse - */ - @Test - public void testGetMeResponse() { - // TODO: test GetMeResponse - } - - /** - * Test the property 'username' - */ - @Test - public void usernameTest() { - // TODO: test username - } - - /** - * Test the property 'userId' - */ - @Test - public void userIdTest() { - // TODO: test userId - } - - /** - * Test the property 'firstName' - */ - @Test - public void firstNameTest() { - // TODO: test firstName - } - - /** - * Test the property 'lastName' - */ - @Test - public void lastNameTest() { - // TODO: test lastName - } - - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } - - /** - * Test the property 'creation' - */ - @Test - public void creationTest() { - // TODO: test creation - } - - /** - * Test the property 'tutorialSeen' - */ - @Test - public void tutorialSeenTest() { - // TODO: test tutorialSeen - } - - /** - * Test the property 'role' - */ - @Test - public void roleTest() { - // TODO: test role - } - -}