Add tests for anyof with discriminator (#19021)

* add tests for anyof with discriminator

* remove test

* update samples
This commit is contained in:
William Cheng 2024-06-26 16:00:58 +08:00 committed by GitHub
parent 6b9d95be89
commit 0c4bfe3ffe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 1397 additions and 47 deletions

View File

@ -2202,6 +2202,13 @@ components:
- $ref: '#/components/schemas/Pig'
discriminator:
propertyName: className
mammal_anyof:
anyOf:
- $ref: '#/components/schemas/whale'
- $ref: '#/components/schemas/zebra'
- $ref: '#/components/schemas/Pig'
discriminator:
propertyName: className
whale:
type: object
properties:

View File

@ -1981,6 +1981,13 @@ components:
- $ref: '#/components/schemas/Pig'
discriminator:
propertyName: className
mammal_anyof:
anyOf:
- $ref: '#/components/schemas/whale'
- $ref: '#/components/schemas/zebra'
- $ref: '#/components/schemas/Pig'
discriminator:
propertyName: className
whale:
type: object
properties:

View File

@ -1,47 +0,0 @@
openapi: 3.0.1
info:
title: sample issue 18975
description: sample issue 18975
version: "1.0"
paths:
/sample:
get:
summary: sample
operationId: getSample
responses:
"200":
description: Found vehicle.
content:
application/json:
schema:
$ref: '#/components/schemas/DifficultType'
components:
schemas:
SubA:
required:
- type
type: object
properties:
type:
type: string
sim:
type: string
SubB:
required:
- type
type: object
properties:
type:
type: string
system:
type: string
DifficultType:
type: object
discriminator:
propertyName: type
mapping:
"typeA": '#/components/schemas/SubA'
"typeB": '#/components/schemas/SubB'
anyOf:
- $ref: '#/components/schemas/SubA'
- $ref: '#/components/schemas/SubB'

View File

@ -46,6 +46,7 @@ docs/HasOnlyReadOnly.md
docs/HealthCheckResult.md
docs/IsoscelesTriangle.md
docs/Mammal.md
docs/MammalAnyof.md
docs/MapTest.md
docs/MixedPropertiesAndAdditionalPropertiesClass.md
docs/Model200Response.md
@ -158,6 +159,7 @@ src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
src/main/java/org/openapitools/client/model/HealthCheckResult.java
src/main/java/org/openapitools/client/model/IsoscelesTriangle.java
src/main/java/org/openapitools/client/model/Mammal.java
src/main/java/org/openapitools/client/model/MammalAnyof.java
src/main/java/org/openapitools/client/model/MapTest.java
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
src/main/java/org/openapitools/client/model/Model200Response.java

View File

@ -199,6 +199,7 @@ Class | Method | HTTP request | Description
- [HealthCheckResult](docs/HealthCheckResult.md)
- [IsoscelesTriangle](docs/IsoscelesTriangle.md)
- [Mammal](docs/Mammal.md)
- [MammalAnyof](docs/MammalAnyof.md)
- [MapTest](docs/MapTest.md)
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model200Response](docs/Model200Response.md)

View File

@ -2059,6 +2059,13 @@ components:
- $ref: '#/components/schemas/whale'
- $ref: '#/components/schemas/zebra'
- $ref: '#/components/schemas/Pig'
mammal_anyof:
anyOf:
- $ref: '#/components/schemas/whale'
- $ref: '#/components/schemas/zebra'
- $ref: '#/components/schemas/Pig'
discriminator:
propertyName: className
whale:
properties:
hasBaleen:

View File

@ -0,0 +1,46 @@
# MammalAnyof
## anyOf schemas
* [Pig](Pig.md)
* [Whale](Whale.md)
* [Zebra](Zebra.md)
## Example
```java
// Import classes:
import org.openapitools.client.model.MammalAnyof;
import org.openapitools.client.model.Pig;
import org.openapitools.client.model.Whale;
import org.openapitools.client.model.Zebra;
public class Example {
public static void main(String[] args) {
MammalAnyof exampleMammalAnyof = new MammalAnyof();
// create a new Pig
Pig examplePig = new Pig();
// set MammalAnyof to Pig
exampleMammalAnyof.setActualInstance(examplePig);
// to get back the Pig set earlier
Pig testPig = (Pig) exampleMammalAnyof.getActualInstance();
// create a new Whale
Whale exampleWhale = new Whale();
// set MammalAnyof to Whale
exampleMammalAnyof.setActualInstance(exampleWhale);
// to get back the Whale set earlier
Whale testWhale = (Whale) exampleMammalAnyof.getActualInstance();
// create a new Zebra
Zebra exampleZebra = new Zebra();
// set MammalAnyof to Zebra
exampleMammalAnyof.setActualInstance(exampleZebra);
// to get back the Zebra set earlier
Zebra testZebra = (Zebra) exampleMammalAnyof.getActualInstance();
}
}
```

View File

@ -0,0 +1,320 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import org.openapitools.client.model.Pig;
import org.openapitools.client.model.Whale;
import org.openapitools.client.model.Zebra;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import org.openapitools.client.JSON;
import jakarta.ws.rs.core.GenericType;
import jakarta.ws.rs.core.Response;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import org.openapitools.client.JSON;
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0-SNAPSHOT")
@JsonDeserialize(using=MammalAnyof.MammalAnyofDeserializer.class)
@JsonSerialize(using = MammalAnyof.MammalAnyofSerializer.class)
public class MammalAnyof extends AbstractOpenApiSchema {
private static final Logger log = Logger.getLogger(MammalAnyof.class.getName());
public static class MammalAnyofSerializer extends StdSerializer<MammalAnyof> {
public MammalAnyofSerializer(Class<MammalAnyof> t) {
super(t);
}
public MammalAnyofSerializer() {
this(null);
}
@Override
public void serialize(MammalAnyof value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
jgen.writeObject(value.getActualInstance());
}
}
public static class MammalAnyofDeserializer extends StdDeserializer<MammalAnyof> {
public MammalAnyofDeserializer() {
this(MammalAnyof.class);
}
public MammalAnyofDeserializer(Class<?> vc) {
super(vc);
}
@Override
public MammalAnyof deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
JsonNode tree = jp.readValueAsTree();
Object deserialized = null;
Class<?> cls = JSON.getClassForElement(tree, new MammalAnyof().getClass());
if (cls != null) {
// When the OAS schema includes a discriminator, use the discriminator value to
// discriminate the anyOf schemas.
// Get the discriminator mapping value to get the class.
deserialized = tree.traverse(jp.getCodec()).readValueAs(cls);
MammalAnyof ret = new MammalAnyof();
ret.setActualInstance(deserialized);
return ret;
}
// deserialize Pig
try {
deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class);
MammalAnyof ret = new MammalAnyof();
ret.setActualInstance(deserialized);
return ret;
} catch (Exception e) {
// deserialization failed, continue, log to help debugging
log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e);
}
// deserialize Whale
try {
deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class);
MammalAnyof ret = new MammalAnyof();
ret.setActualInstance(deserialized);
return ret;
} catch (Exception e) {
// deserialization failed, continue, log to help debugging
log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e);
}
// deserialize Zebra
try {
deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class);
MammalAnyof ret = new MammalAnyof();
ret.setActualInstance(deserialized);
return ret;
} catch (Exception e) {
// deserialization failed, continue, log to help debugging
log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e);
}
throw new IOException(String.format("Failed deserialization for MammalAnyof: no match found"));
}
/**
* Handle deserialization of the 'null' value.
*/
@Override
public MammalAnyof getNullValue(DeserializationContext ctxt) throws JsonMappingException {
throw new JsonMappingException(ctxt.getParser(), "MammalAnyof cannot be null");
}
}
// store a list of schema names defined in anyOf
public static final Map<String, GenericType> schemas = new HashMap<>();
public MammalAnyof() {
super("anyOf", Boolean.FALSE);
}
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
* the 'additionalProperties' keyword in the OAS document.
*/
private Map<String, Object> additionalProperties;
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*/
@JsonAnySetter
public MammalAnyof putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap<>();
}
this.additionalProperties.put(key, value);
return this;
}
/**
* Return the additional (undeclared) property.
*/
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
/**
* Return true if this mammal_anyof object is equal to o.
*/
@Override
public boolean equals(Object o) {
return super.equals(o) && Objects.equals(this.additionalProperties, ((MammalAnyof)o).additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties);
}
public MammalAnyof(Pig o) {
super("anyOf", Boolean.FALSE);
setActualInstance(o);
}
public MammalAnyof(Whale o) {
super("anyOf", Boolean.FALSE);
setActualInstance(o);
}
public MammalAnyof(Zebra o) {
super("anyOf", Boolean.FALSE);
setActualInstance(o);
}
static {
schemas.put("Pig", new GenericType<Pig>() {
});
schemas.put("Whale", new GenericType<Whale>() {
});
schemas.put("Zebra", new GenericType<Zebra>() {
});
JSON.registerDescendants(MammalAnyof.class, Collections.unmodifiableMap(schemas));
// Initialize and register the discriminator mappings.
Map<String, Class<?>> mappings = new HashMap<>();
mappings.put("Pig", Pig.class);
mappings.put("whale", Whale.class);
mappings.put("zebra", Zebra.class);
mappings.put("mammal_anyof", MammalAnyof.class);
JSON.registerDiscriminator(MammalAnyof.class, "className", mappings);
}
@Override
public Map<String, GenericType> getSchemas() {
return MammalAnyof.schemas;
}
/**
* Set the instance that matches the anyOf child schema, check
* the instance parameter is valid against the anyOf child schemas:
* Pig, Whale, Zebra
*
* It could be an instance of the 'anyOf' schemas.
* The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf).
*/
@Override
public void setActualInstance(Object instance) {
if (JSON.isInstanceOf(Pig.class, instance, new HashSet<>())) {
super.setActualInstance(instance);
return;
}
if (JSON.isInstanceOf(Whale.class, instance, new HashSet<>())) {
super.setActualInstance(instance);
return;
}
if (JSON.isInstanceOf(Zebra.class, instance, new HashSet<>())) {
super.setActualInstance(instance);
return;
}
throw new RuntimeException("Invalid instance type. Must be Pig, Whale, Zebra");
}
/**
* Get the actual instance, which can be the following:
* Pig, Whale, Zebra
*
* @return The actual instance (Pig, Whale, Zebra)
*/
@Override
public Object getActualInstance() {
return super.getActualInstance();
}
/**
* Get the actual instance of `Pig`. If the actual instance is not `Pig`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Pig`
* @throws ClassCastException if the instance is not `Pig`
*/
public Pig getPig() throws ClassCastException {
return (Pig)super.getActualInstance();
}
/**
* Get the actual instance of `Whale`. If the actual instance is not `Whale`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Whale`
* @throws ClassCastException if the instance is not `Whale`
*/
public Whale getWhale() throws ClassCastException {
return (Whale)super.getActualInstance();
}
/**
* Get the actual instance of `Zebra`. If the actual instance is not `Zebra`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Zebra`
* @throws ClassCastException if the instance is not `Zebra`
*/
public Zebra getZebra() throws ClassCastException {
return (Zebra)super.getActualInstance();
}
}

View File

@ -0,0 +1,79 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import org.openapitools.client.model.Pig;
import org.openapitools.client.model.Whale;
import org.openapitools.client.model.Zebra;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for MammalAnyof
*/
public class MammalAnyofTest {
private final MammalAnyof model = new MammalAnyof();
/**
* Model tests for MammalAnyof
*/
@Test
public void testMammalAnyof() {
// TODO: test MammalAnyof
}
/**
* Test the property 'hasBaleen'
*/
@Test
public void hasBaleenTest() {
// TODO: test hasBaleen
}
/**
* Test the property 'hasTeeth'
*/
@Test
public void hasTeethTest() {
// TODO: test hasTeeth
}
/**
* Test the property 'className'
*/
@Test
public void classNameTest() {
// TODO: test className
}
/**
* Test the property 'type'
*/
@Test
public void typeTest() {
// TODO: test type
}
}

View File

@ -60,6 +60,7 @@ docs/HasOnlyReadOnly.md
docs/HealthCheckResult.md
docs/IsoscelesTriangle.md
docs/Mammal.md
docs/MammalAnyof.md
docs/MapTest.md
docs/MixedPropertiesAndAdditionalPropertiesClass.md
docs/Model200Response.md
@ -203,6 +204,7 @@ src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
src/main/java/org/openapitools/client/model/HealthCheckResult.java
src/main/java/org/openapitools/client/model/IsoscelesTriangle.java
src/main/java/org/openapitools/client/model/Mammal.java
src/main/java/org/openapitools/client/model/MammalAnyof.java
src/main/java/org/openapitools/client/model/MapTest.java
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
src/main/java/org/openapitools/client/model/Model200Response.java

View File

@ -220,6 +220,7 @@ Class | Method | HTTP request | Description
- [HealthCheckResult](docs/HealthCheckResult.md)
- [IsoscelesTriangle](docs/IsoscelesTriangle.md)
- [Mammal](docs/Mammal.md)
- [MammalAnyof](docs/MammalAnyof.md)
- [MapTest](docs/MapTest.md)
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model200Response](docs/Model200Response.md)

View File

@ -2298,6 +2298,13 @@ components:
- $ref: '#/components/schemas/whale'
- $ref: '#/components/schemas/zebra'
- $ref: '#/components/schemas/Pig'
mammal_anyof:
anyOf:
- $ref: '#/components/schemas/whale'
- $ref: '#/components/schemas/zebra'
- $ref: '#/components/schemas/Pig'
discriminator:
propertyName: className
whale:
properties:
hasBaleen:

View File

@ -0,0 +1,26 @@
# MammalAnyof
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**hasBaleen** | **Boolean** | | [optional] |
|**hasTeeth** | **Boolean** | | [optional] |
|**className** | **String** | | |
|**type** | [**TypeEnum**](#TypeEnum) | | [optional] |
## Enum: TypeEnum
| Name | Value |
|---- | -----|
| PLAINS | &quot;plains&quot; |
| MOUNTAIN | &quot;mountain&quot; |
| GREVYS | &quot;grevys&quot; |

View File

@ -117,6 +117,18 @@ public class JSON {
return getClassByDiscriminator(classByDiscriminatorValue,
getDiscriminatorValue(readElement, "className"));
}
})
.registerTypeSelector(org.openapitools.client.model.MammalAnyof.class, new TypeSelector<org.openapitools.client.model.MammalAnyof>() {
@Override
public Class<? extends org.openapitools.client.model.MammalAnyof> getClassForElement(JsonElement readElement) {
Map<String, Class> classByDiscriminatorValue = new HashMap<String, Class>();
classByDiscriminatorValue.put("Pig", org.openapitools.client.model.Pig.class);
classByDiscriminatorValue.put("whale", org.openapitools.client.model.Whale.class);
classByDiscriminatorValue.put("zebra", org.openapitools.client.model.Zebra.class);
classByDiscriminatorValue.put("mammal_anyof", org.openapitools.client.model.MammalAnyof.class);
return getClassByDiscriminator(classByDiscriminatorValue,
getDiscriminatorValue(readElement, "className"));
}
})
.registerTypeSelector(org.openapitools.client.model.NullableShape.class, new TypeSelector<org.openapitools.client.model.NullableShape>() {
@Override
@ -277,6 +289,7 @@ public class JSON {
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HealthCheckResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IsoscelesTriangle.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Mammal.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MammalAnyof.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MapTest.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MixedPropertiesAndAdditionalPropertiesClass.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Model200Response.CustomTypeAdapterFactory());

View File

@ -0,0 +1,311 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
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.util.Arrays;
import org.openapitools.client.model.Pig;
import org.openapitools.client.model.Whale;
import org.openapitools.client.model.Zebra;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapter;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.JsonPrimitive;
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 com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonArray;
import com.google.gson.JsonParseException;
import org.openapitools.client.JSON;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0-SNAPSHOT")
public class MammalAnyof extends AbstractOpenApiSchema {
private static final Logger log = Logger.getLogger(MammalAnyof.class.getName());
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!MammalAnyof.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'MammalAnyof' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<Whale> adapterWhale = gson.getDelegateAdapter(this, TypeToken.get(Whale.class));
final TypeAdapter<Zebra> adapterZebra = gson.getDelegateAdapter(this, TypeToken.get(Zebra.class));
final TypeAdapter<Pig> adapterPig = gson.getDelegateAdapter(this, TypeToken.get(Pig.class));
return (TypeAdapter<T>) new TypeAdapter<MammalAnyof>() {
@Override
public void write(JsonWriter out, MammalAnyof value) throws IOException {
if (value == null || value.getActualInstance() == null) {
elementAdapter.write(out, null);
return;
}
// check if the actual instance is of the type `Whale`
if (value.getActualInstance() instanceof Whale) {
JsonElement element = adapterWhale.toJsonTree((Whale)value.getActualInstance());
elementAdapter.write(out, element);
return;
}
// check if the actual instance is of the type `Zebra`
if (value.getActualInstance() instanceof Zebra) {
JsonElement element = adapterZebra.toJsonTree((Zebra)value.getActualInstance());
elementAdapter.write(out, element);
return;
}
// check if the actual instance is of the type `Pig`
if (value.getActualInstance() instanceof Pig) {
JsonElement element = adapterPig.toJsonTree((Pig)value.getActualInstance());
elementAdapter.write(out, element);
return;
}
throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: Pig, Whale, Zebra");
}
@Override
public MammalAnyof read(JsonReader in) throws IOException {
Object deserialized = null;
JsonElement jsonElement = elementAdapter.read(in);
ArrayList<String> errorMessages = new ArrayList<>();
TypeAdapter actualAdapter = elementAdapter;
// deserialize Whale
try {
// validate the JSON object to see if any exception is thrown
Whale.validateJsonElement(jsonElement);
actualAdapter = adapterWhale;
MammalAnyof ret = new MammalAnyof();
ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement));
return ret;
} catch (Exception e) {
// deserialization failed, continue
errorMessages.add(String.format("Deserialization for Whale failed with `%s`.", e.getMessage()));
log.log(Level.FINER, "Input data does not match schema 'Whale'", e);
}
// deserialize Zebra
try {
// validate the JSON object to see if any exception is thrown
Zebra.validateJsonElement(jsonElement);
actualAdapter = adapterZebra;
MammalAnyof ret = new MammalAnyof();
ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement));
return ret;
} catch (Exception e) {
// deserialization failed, continue
errorMessages.add(String.format("Deserialization for Zebra failed with `%s`.", e.getMessage()));
log.log(Level.FINER, "Input data does not match schema 'Zebra'", e);
}
// deserialize Pig
try {
// validate the JSON object to see if any exception is thrown
Pig.validateJsonElement(jsonElement);
actualAdapter = adapterPig;
MammalAnyof ret = new MammalAnyof();
ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement));
return ret;
} catch (Exception e) {
// deserialization failed, continue
errorMessages.add(String.format("Deserialization for Pig failed with `%s`.", e.getMessage()));
log.log(Level.FINER, "Input data does not match schema 'Pig'", e);
}
throw new IOException(String.format("Failed deserialization for MammalAnyof: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString()));
}
}.nullSafe();
}
}
// store a list of schema names defined in anyOf
public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>();
public MammalAnyof() {
super("anyOf", Boolean.FALSE);
}
public MammalAnyof(Object o) {
super("anyOf", Boolean.FALSE);
setActualInstance(o);
}
static {
schemas.put("Whale", Whale.class);
schemas.put("Zebra", Zebra.class);
schemas.put("Pig", Pig.class);
}
@Override
public Map<String, Class<?>> getSchemas() {
return MammalAnyof.schemas;
}
/**
* Set the instance that matches the anyOf child schema, check
* the instance parameter is valid against the anyOf child schemas:
* Pig, Whale, Zebra
*
* It could be an instance of the 'anyOf' schemas.
*/
@Override
public void setActualInstance(Object instance) {
if (instance instanceof Whale) {
super.setActualInstance(instance);
return;
}
if (instance instanceof Zebra) {
super.setActualInstance(instance);
return;
}
if (instance instanceof Pig) {
super.setActualInstance(instance);
return;
}
throw new RuntimeException("Invalid instance type. Must be Pig, Whale, Zebra");
}
/**
* Get the actual instance, which can be the following:
* Pig, Whale, Zebra
*
* @return The actual instance (Pig, Whale, Zebra)
*/
@SuppressWarnings("unchecked")
@Override
public Object getActualInstance() {
return super.getActualInstance();
}
/**
* Get the actual instance of `Whale`. If the actual instance is not `Whale`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Whale`
* @throws ClassCastException if the instance is not `Whale`
*/
public Whale getWhale() throws ClassCastException {
return (Whale)super.getActualInstance();
}
/**
* Get the actual instance of `Zebra`. If the actual instance is not `Zebra`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Zebra`
* @throws ClassCastException if the instance is not `Zebra`
*/
public Zebra getZebra() throws ClassCastException {
return (Zebra)super.getActualInstance();
}
/**
* Get the actual instance of `Pig`. If the actual instance is not `Pig`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Pig`
* @throws ClassCastException if the instance is not `Pig`
*/
public Pig getPig() throws ClassCastException {
return (Pig)super.getActualInstance();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to MammalAnyof
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
// validate anyOf schemas one by one
ArrayList<String> errorMessages = new ArrayList<>();
// validate the json string with Whale
try {
Whale.validateJsonElement(jsonElement);
return;
} catch (Exception e) {
errorMessages.add(String.format("Deserialization for Whale failed with `%s`.", e.getMessage()));
// continue to the next one
}
// validate the json string with Zebra
try {
Zebra.validateJsonElement(jsonElement);
return;
} catch (Exception e) {
errorMessages.add(String.format("Deserialization for Zebra failed with `%s`.", e.getMessage()));
// continue to the next one
}
// validate the json string with Pig
try {
Pig.validateJsonElement(jsonElement);
return;
} catch (Exception e) {
errorMessages.add(String.format("Deserialization for Pig failed with `%s`.", e.getMessage()));
// continue to the next one
}
throw new IOException(String.format("The JSON string is invalid for MammalAnyof with anyOf schemas: Pig, Whale, Zebra. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString()));
}
/**
* Create an instance of MammalAnyof given an JSON string
*
* @param jsonString JSON string
* @return An instance of MammalAnyof
* @throws IOException if the JSON string is invalid with respect to MammalAnyof
*/
public static MammalAnyof fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, MammalAnyof.class);
}
/**
* Convert an instance of MammalAnyof to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}

View File

@ -0,0 +1,75 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.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.util.Arrays;
import org.openapitools.client.model.Pig;
import org.openapitools.client.model.Whale;
import org.openapitools.client.model.Zebra;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for MammalAnyof
*/
public class MammalAnyofTest {
private final MammalAnyof model = new MammalAnyof();
/**
* Model tests for MammalAnyof
*/
@Test
public void testMammalAnyof() {
// TODO: test MammalAnyof
}
/**
* Test the property 'hasBaleen'
*/
@Test
public void hasBaleenTest() {
// TODO: test hasBaleen
}
/**
* Test the property 'hasTeeth'
*/
@Test
public void hasTeethTest() {
// TODO: test hasTeeth
}
/**
* Test the property 'className'
*/
@Test
public void classNameTest() {
// TODO: test className
}
/**
* Test the property 'type'
*/
@Test
public void typeTest() {
// TODO: test type
}
}

View File

@ -910,6 +910,46 @@ export interface List {
*/
export type Mammal = Pig | Whale | Zebra;
/**
*
* @export
* @interface MammalAnyof
*/
export interface MammalAnyof {
/**
*
* @type {boolean}
* @memberof MammalAnyof
*/
'hasBaleen'?: boolean;
/**
*
* @type {boolean}
* @memberof MammalAnyof
*/
'hasTeeth'?: boolean;
/**
*
* @type {string}
* @memberof MammalAnyof
*/
'className': string;
/**
*
* @type {string}
* @memberof MammalAnyof
*/
'type'?: MammalAnyofTypeEnum;
}
export const MammalAnyofTypeEnum = {
Plains: 'plains',
Mountain: 'mountain',
Grevys: 'grevys'
} as const;
export type MammalAnyofTypeEnum = typeof MammalAnyofTypeEnum[keyof typeof MammalAnyofTypeEnum];
/**
*
* @export

View File

@ -46,6 +46,7 @@ docs/HasOnlyReadOnly.md
docs/HealthCheckResult.md
docs/IsoscelesTriangle.md
docs/Mammal.md
docs/MammalAnyof.md
docs/MapTest.md
docs/MixedPropertiesAndAdditionalPropertiesClass.md
docs/Model200Response.md
@ -158,6 +159,7 @@ src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
src/main/java/org/openapitools/client/model/HealthCheckResult.java
src/main/java/org/openapitools/client/model/IsoscelesTriangle.java
src/main/java/org/openapitools/client/model/Mammal.java
src/main/java/org/openapitools/client/model/MammalAnyof.java
src/main/java/org/openapitools/client/model/MapTest.java
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
src/main/java/org/openapitools/client/model/Model200Response.java

View File

@ -224,6 +224,7 @@ Class | Method | HTTP request | Description
- [HealthCheckResult](docs/HealthCheckResult.md)
- [IsoscelesTriangle](docs/IsoscelesTriangle.md)
- [Mammal](docs/Mammal.md)
- [MammalAnyof](docs/MammalAnyof.md)
- [MapTest](docs/MapTest.md)
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model200Response](docs/Model200Response.md)

View File

@ -2059,6 +2059,13 @@ components:
- $ref: '#/components/schemas/whale'
- $ref: '#/components/schemas/zebra'
- $ref: '#/components/schemas/Pig'
mammal_anyof:
anyOf:
- $ref: '#/components/schemas/whale'
- $ref: '#/components/schemas/zebra'
- $ref: '#/components/schemas/Pig'
discriminator:
propertyName: className
whale:
properties:
hasBaleen:

View File

@ -0,0 +1,46 @@
# MammalAnyof
## anyOf schemas
* [Pig](Pig.md)
* [Whale](Whale.md)
* [Zebra](Zebra.md)
## Example
```java
// Import classes:
import org.openapitools.client.model.MammalAnyof;
import org.openapitools.client.model.Pig;
import org.openapitools.client.model.Whale;
import org.openapitools.client.model.Zebra;
public class Example {
public static void main(String[] args) {
MammalAnyof exampleMammalAnyof = new MammalAnyof();
// create a new Pig
Pig examplePig = new Pig();
// set MammalAnyof to Pig
exampleMammalAnyof.setActualInstance(examplePig);
// to get back the Pig set earlier
Pig testPig = (Pig) exampleMammalAnyof.getActualInstance();
// create a new Whale
Whale exampleWhale = new Whale();
// set MammalAnyof to Whale
exampleMammalAnyof.setActualInstance(exampleWhale);
// to get back the Whale set earlier
Whale testWhale = (Whale) exampleMammalAnyof.getActualInstance();
// create a new Zebra
Zebra exampleZebra = new Zebra();
// set MammalAnyof to Zebra
exampleMammalAnyof.setActualInstance(exampleZebra);
// to get back the Zebra set earlier
Zebra testZebra = (Zebra) exampleMammalAnyof.getActualInstance();
}
}
```

View File

@ -0,0 +1,318 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import org.openapitools.client.model.Pig;
import org.openapitools.client.model.Whale;
import org.openapitools.client.model.Zebra;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.openapitools.client.JSON;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import org.openapitools.client.JSON;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0-SNAPSHOT")
@JsonDeserialize(using=MammalAnyof.MammalAnyofDeserializer.class)
@JsonSerialize(using = MammalAnyof.MammalAnyofSerializer.class)
public class MammalAnyof extends AbstractOpenApiSchema {
private static final Logger log = Logger.getLogger(MammalAnyof.class.getName());
public static class MammalAnyofSerializer extends StdSerializer<MammalAnyof> {
public MammalAnyofSerializer(Class<MammalAnyof> t) {
super(t);
}
public MammalAnyofSerializer() {
this(null);
}
@Override
public void serialize(MammalAnyof value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
jgen.writeObject(value.getActualInstance());
}
}
public static class MammalAnyofDeserializer extends StdDeserializer<MammalAnyof> {
public MammalAnyofDeserializer() {
this(MammalAnyof.class);
}
public MammalAnyofDeserializer(Class<?> vc) {
super(vc);
}
@Override
public MammalAnyof deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
JsonNode tree = jp.readValueAsTree();
Object deserialized = null;
Class<?> cls = JSON.getClassForElement(tree, new MammalAnyof().getClass());
if (cls != null) {
// When the OAS schema includes a discriminator, use the discriminator value to
// discriminate the anyOf schemas.
// Get the discriminator mapping value to get the class.
deserialized = tree.traverse(jp.getCodec()).readValueAs(cls);
MammalAnyof ret = new MammalAnyof();
ret.setActualInstance(deserialized);
return ret;
}
// deserialize Pig
try {
deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class);
MammalAnyof ret = new MammalAnyof();
ret.setActualInstance(deserialized);
return ret;
} catch (Exception e) {
// deserialization failed, continue, log to help debugging
log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e);
}
// deserialize Whale
try {
deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class);
MammalAnyof ret = new MammalAnyof();
ret.setActualInstance(deserialized);
return ret;
} catch (Exception e) {
// deserialization failed, continue, log to help debugging
log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e);
}
// deserialize Zebra
try {
deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class);
MammalAnyof ret = new MammalAnyof();
ret.setActualInstance(deserialized);
return ret;
} catch (Exception e) {
// deserialization failed, continue, log to help debugging
log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e);
}
throw new IOException(String.format("Failed deserialization for MammalAnyof: no match found"));
}
/**
* Handle deserialization of the 'null' value.
*/
@Override
public MammalAnyof getNullValue(DeserializationContext ctxt) throws JsonMappingException {
throw new JsonMappingException(ctxt.getParser(), "MammalAnyof cannot be null");
}
}
// store a list of schema names defined in anyOf
public static final Map<String, GenericType> schemas = new HashMap<>();
public MammalAnyof() {
super("anyOf", Boolean.FALSE);
}
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
* the 'additionalProperties' keyword in the OAS document.
*/
private Map<String, Object> additionalProperties;
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*/
@JsonAnySetter
public MammalAnyof putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap<>();
}
this.additionalProperties.put(key, value);
return this;
}
/**
* Return the additional (undeclared) property.
*/
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
/**
* Return true if this mammal_anyof object is equal to o.
*/
@Override
public boolean equals(Object o) {
return super.equals(o) && Objects.equals(this.additionalProperties, ((MammalAnyof)o).additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties);
}
public MammalAnyof(Pig o) {
super("anyOf", Boolean.FALSE);
setActualInstance(o);
}
public MammalAnyof(Whale o) {
super("anyOf", Boolean.FALSE);
setActualInstance(o);
}
public MammalAnyof(Zebra o) {
super("anyOf", Boolean.FALSE);
setActualInstance(o);
}
static {
schemas.put("Pig", new GenericType<Pig>() {
});
schemas.put("Whale", new GenericType<Whale>() {
});
schemas.put("Zebra", new GenericType<Zebra>() {
});
JSON.registerDescendants(MammalAnyof.class, Collections.unmodifiableMap(schemas));
// Initialize and register the discriminator mappings.
Map<String, Class<?>> mappings = new HashMap<>();
mappings.put("Pig", Pig.class);
mappings.put("whale", Whale.class);
mappings.put("zebra", Zebra.class);
mappings.put("mammal_anyof", MammalAnyof.class);
JSON.registerDiscriminator(MammalAnyof.class, "className", mappings);
}
@Override
public Map<String, GenericType> getSchemas() {
return MammalAnyof.schemas;
}
/**
* Set the instance that matches the anyOf child schema, check
* the instance parameter is valid against the anyOf child schemas:
* Pig, Whale, Zebra
*
* It could be an instance of the 'anyOf' schemas.
* The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf).
*/
@Override
public void setActualInstance(Object instance) {
if (JSON.isInstanceOf(Pig.class, instance, new HashSet<>())) {
super.setActualInstance(instance);
return;
}
if (JSON.isInstanceOf(Whale.class, instance, new HashSet<>())) {
super.setActualInstance(instance);
return;
}
if (JSON.isInstanceOf(Zebra.class, instance, new HashSet<>())) {
super.setActualInstance(instance);
return;
}
throw new RuntimeException("Invalid instance type. Must be Pig, Whale, Zebra");
}
/**
* Get the actual instance, which can be the following:
* Pig, Whale, Zebra
*
* @return The actual instance (Pig, Whale, Zebra)
*/
@Override
public Object getActualInstance() {
return super.getActualInstance();
}
/**
* Get the actual instance of `Pig`. If the actual instance is not `Pig`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Pig`
* @throws ClassCastException if the instance is not `Pig`
*/
public Pig getPig() throws ClassCastException {
return (Pig)super.getActualInstance();
}
/**
* Get the actual instance of `Whale`. If the actual instance is not `Whale`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Whale`
* @throws ClassCastException if the instance is not `Whale`
*/
public Whale getWhale() throws ClassCastException {
return (Whale)super.getActualInstance();
}
/**
* Get the actual instance of `Zebra`. If the actual instance is not `Zebra`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Zebra`
* @throws ClassCastException if the instance is not `Zebra`
*/
public Zebra getZebra() throws ClassCastException {
return (Zebra)super.getActualInstance();
}
}

View File

@ -0,0 +1,79 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import org.openapitools.client.model.Pig;
import org.openapitools.client.model.Whale;
import org.openapitools.client.model.Zebra;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for MammalAnyof
*/
public class MammalAnyofTest {
private final MammalAnyof model = new MammalAnyof();
/**
* Model tests for MammalAnyof
*/
@Test
public void testMammalAnyof() {
// TODO: test MammalAnyof
}
/**
* Test the property 'hasBaleen'
*/
@Test
public void hasBaleenTest() {
// TODO: test hasBaleen
}
/**
* Test the property 'hasTeeth'
*/
@Test
public void hasTeethTest() {
// TODO: test hasTeeth
}
/**
* Test the property 'className'
*/
@Test
public void classNameTest() {
// TODO: test className
}
/**
* Test the property 'type'
*/
@Test
public void typeTest() {
// TODO: test type
}
}