Skip to content

Commit

Permalink
Maintenance: remove package handling for model examples, add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sschnabe committed Aug 15, 2023
1 parent ebfb7dc commit dfbc4d7
Show file tree
Hide file tree
Showing 37 changed files with 60 additions and 103 deletions.
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;
}
}
10 changes: 10 additions & 0 deletions gen/test/java/testapi/packages/model/NumberModelTestExample.java
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;
}
}
10 changes: 10 additions & 0 deletions gen/test/java/testapi/packages/model/StringModelTestExample.java
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

0 comments on commit dfbc4d7

Please sign in to comment.