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

Maintenance: remove package handling for model examples, add test cases #275

Merged
merged 1 commit into from
Aug 15, 2023
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
13 changes: 13 additions & 0 deletions gen/test/java/testapi/packages/model/MultipartTestExample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package testapi.packages.model;

public class MultipartTestExample {

public static Multipart build() {
Multipart exampleInstance = new Multipart();
exampleInstance.setOrderId(12);
exampleInstance.setUserId(12);
exampleInstance.setFileName("string");
exampleInstance.setFile("byteArray".getBytes());
return exampleInstance;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package testapi.packages.model;

public class NumberModelTestExample {

public static NumberModel build() {
NumberModel exampleInstance = new NumberModel();
exampleInstance.setBar(12.34);
return exampleInstance;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package testapi.packages.model;

public class ParameterModelTestExample {

public static ParameterModel build() {
ParameterModel exampleInstance = new ParameterModel();
exampleInstance.setBool("string");
exampleInstance.setString("string");
exampleInstance.setNumber(12.34);
exampleInstance.setInteger(12);
exampleInstance.setUuid(java.util.UUID.randomUUID());
exampleInstance.setDate(null);
exampleInstance.setDateTime(null);
exampleInstance.setA(java.util.List.of());
exampleInstance.setB(java.util.List.of());
exampleInstance.setC(java.util.List.of());
return exampleInstance;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package testapi.packages.model;

public class StringModelTestExample {

public static StringModel build() {
StringModel exampleInstance = new StringModel();
exampleInstance.setFoo("string");
return exampleInstance;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.AdditionalPropertiesModel.*;

public class AdditionalPropertiesModelTestExample {

public static AdditionalPropertiesModel build() {
AdditionalPropertiesModel exampleInstance = new AdditionalPropertiesModel();
//initialize fields
exampleInstance.setId("string");
return exampleInstance;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.AdditionalPropertiesModelValue.*;

public class AdditionalPropertiesModelValueTestExample {

public static AdditionalPropertiesModelValue build() {
// use the first found implementation as example
return PropertyTypeOneTestExample.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.EnumerationInteger.*;

public class EnumerationIntegerTestExample {

public static EnumerationInteger build() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.EnumerationModel.*;

public class EnumerationModelTestExample {

public static EnumerationModel build() {
EnumerationModel exampleInstance = new EnumerationModel();
//initialize fields
exampleInstance.setString(null);
exampleInstance.setStringDefault(null);
exampleInstance.setEmbedded(Embedded.toEnum("first"));
exampleInstance.setEmbeddedDefault(EmbeddedDefault.toEnum("four"));
exampleInstance.setEmbedded(EnumerationModel.Embedded.toEnum("first"));
exampleInstance.setEmbeddedDefault(EnumerationModel.EmbeddedDefault.toEnum("four"));
return exampleInstance;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.EnumerationNumber.*;

public class EnumerationNumberTestExample {

public static EnumerationNumber build() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.EnumerationStringDefault.*;

public class EnumerationStringDefaultTestExample {

public static EnumerationStringDefault build() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.EnumerationString.*;

public class EnumerationStringTestExample {

public static EnumerationString build() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.FirstModel.*;

public class FirstModelTestExample {

public static FirstModel build() {
FirstModel exampleInstance = new FirstModel();
//initialize fields
exampleInstance.setType("string");
exampleInstance.setFirst("string");
exampleInstance.setSecondLevel(null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceExtended.*;

public class InheritanceExtendedTestExample {

public static InheritanceExtended build() {
InheritanceExtended exampleInstance = new InheritanceExtended();
//initialize fields
exampleInstance.setFoo("string");
exampleInstance.setBar("string");
return exampleInstance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceSimple.*;

public class InheritanceSimpleTestExample {

public static InheritanceSimple build() {
InheritanceSimple exampleInstance = new InheritanceSimple();
//initialize fields
exampleInstance.setFoo("string");
return exampleInstance;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceWithEnumType1.*;

public class InheritanceWithEnumType1TestExample {

public static InheritanceWithEnumType1 build() {
InheritanceWithEnumType1 exampleInstance = new InheritanceWithEnumType1();
//initialize fields
exampleInstance.setD("string");
return exampleInstance;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceWithEnumType2.*;

public class InheritanceWithEnumType2TestExample {

public static InheritanceWithEnumType2 build() {
InheritanceWithEnumType2 exampleInstance = new InheritanceWithEnumType2();
//initialize fields
exampleInstance.setE("string");
return exampleInstance;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceWithEnumType3.*;

public class InheritanceWithEnumType3TestExample {

public static InheritanceWithEnumType3 build() {
InheritanceWithEnumType3 exampleInstance = new InheritanceWithEnumType3();
//initialize fields
return exampleInstance;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceWithEnumTypeEnum.*;

public class InheritanceWithEnumTypeEnumTestExample {

public static InheritanceWithEnumTypeEnum build() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceWithEnumType.*;

public class InheritanceWithEnumTypeTestExample {

public static InheritanceWithEnumType build() {
// use the first found implementation as example
return InheritanceWithEnumType1TestExample.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceWithStringType1.*;

public class InheritanceWithStringType1TestExample {

public static InheritanceWithStringType1 build() {
InheritanceWithStringType1 exampleInstance = new InheritanceWithStringType1();
//initialize fields
exampleInstance.setA("string");
exampleInstance.setB("string");
return exampleInstance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceWithStringType2.*;

public class InheritanceWithStringType2TestExample {

public static InheritanceWithStringType2 build() {
InheritanceWithStringType2 exampleInstance = new InheritanceWithStringType2();
//initialize fields
exampleInstance.setA("string");
exampleInstance.setC("string");
return exampleInstance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceWithStringType.*;

public class InheritanceWithStringTypeTestExample {

public static InheritanceWithStringType build() {
// use the first found implementation as example
return InheritanceWithStringType1TestExample.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceWithoutType1.*;

public class InheritanceWithoutType1TestExample {

public static InheritanceWithoutType1 build() {
InheritanceWithoutType1 exampleInstance = new InheritanceWithoutType1();
//initialize fields
exampleInstance.setE("string");
exampleInstance.setF("string");
return exampleInstance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceWithoutType2.*;

public class InheritanceWithoutType2TestExample {

public static InheritanceWithoutType2 build() {
InheritanceWithoutType2 exampleInstance = new InheritanceWithoutType2();
//initialize fields
exampleInstance.setE("string");
exampleInstance.setG("string");
return exampleInstance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.InheritanceWithoutType.*;

public class InheritanceWithoutTypeTestExample {

public static InheritanceWithoutType build() {
// use the first found implementation as example
return InheritanceWithoutType1TestExample.build();
}
}
3 changes: 0 additions & 3 deletions gen/test/java/testmodel/nomicronaut/ModelTestExample.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.Model.*;

public class ModelTestExample {

public static Model build() {
Model exampleInstance = new Model();
//initialize fields
exampleInstance.setId(12);
exampleInstance.setIdWithExample(32);
exampleInstance.setIdWithDefault(32);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.OneOfImplementor1.*;

public class OneOfImplementor1TestExample {

public static OneOfImplementor1 build() {
OneOfImplementor1 exampleInstance = new OneOfImplementor1();
//initialize fields
exampleInstance.setProperty("string");
return exampleInstance;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.OneOfImplementor2.*;

public class OneOfImplementor2TestExample {

public static OneOfImplementor2 build() {
OneOfImplementor2 exampleInstance = new OneOfImplementor2();
//initialize fields
exampleInstance.setProperty(12.34);
return exampleInstance;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.OneOfInterface.*;

public class OneOfInterfaceTestExample {

public static OneOfInterface build() {
// use the first found implementation as example
return OneOfImplementor1TestExample.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.OneOfModel.*;

public class OneOfModelTestExample {

public static OneOfModel build() {
// use the first found implementation as example
return FirstModelTestExample.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.PropertyTypeOne.*;

public class PropertyTypeOneTestExample {

public static PropertyTypeOne build() {
PropertyTypeOne exampleInstance = new PropertyTypeOne();
//initialize fields
exampleInstance.setType(Type.toEnum("one"));
exampleInstance.setType(PropertyTypeOne.Type.toEnum("one"));
return exampleInstance;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package testmodel.nomicronaut;

import testmodel.nomicronaut.PropertyTypeTwo.*;

public class PropertyTypeTwoTestExample {

public static PropertyTypeTwo build() {
PropertyTypeTwo exampleInstance = new PropertyTypeTwo();
//initialize fields
exampleInstance.setType(Type.toEnum("two"));
exampleInstance.setType(PropertyTypeTwo.Type.toEnum("two"));
return exampleInstance;
}
}
Loading