-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add enumeration test and new entity test
- Loading branch information
1 parent
63e6300
commit c13f355
Showing
13 changed files
with
281 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/arguments/DataXmlDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dk.jyskebank.tools.enunciate.modules.openapi.arguments; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
@XmlRootElement(name="dataXmlDto") | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
public class DataXmlDTO { | ||
@XmlElement | ||
private String simpleStr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/enumeration/DataResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package dk.jyskebank.tools.enunciate.modules.openapi.enumeration; | ||
|
||
import javax.ws.rs.Consumes; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
|
||
import com.webcohesion.enunciate.metadata.rs.TypeHint; | ||
|
||
@Path("/path") | ||
@Produces({ MediaType.APPLICATION_XML}) | ||
@Consumes({ MediaType.APPLICATION_XML}) | ||
public class DataResource { | ||
@TypeHint(RootElementEnum.class) | ||
@GET | ||
@Path("/root") | ||
public Response getRootElementEnum() { | ||
return Response.ok(RootElementEnum.ADMIN).build(); | ||
} | ||
|
||
@Path("/ref") | ||
@TypeHint(DataXmlDTO.class) | ||
@GET | ||
public Response getReferenceEnum() { | ||
return Response.ok(new DataXmlDTO()).build(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/enumeration/DataXmlDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dk.jyskebank.tools.enunciate.modules.openapi.enumeration; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
@XmlRootElement(name="dataXmlDto") | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
public class DataXmlDTO { | ||
@XmlElement | ||
private ReferenceEnum user; | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/enumeration/ReferenceEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package dk.jyskebank.tools.enunciate.modules.openapi.enumeration; | ||
|
||
import javax.xml.bind.annotation.XmlEnum; | ||
|
||
@XmlEnum | ||
public enum ReferenceEnum { | ||
REF_1, | ||
REF_2 | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/enumeration/RestApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package dk.jyskebank.tools.enunciate.modules.openapi.enumeration; | ||
|
||
import javax.ws.rs.ApplicationPath; | ||
import javax.ws.rs.core.Application; | ||
|
||
@ApplicationPath("rest") | ||
public class RestApplication extends Application { | ||
} |
13 changes: 13 additions & 0 deletions
13
src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/enumeration/RootElementEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dk.jyskebank.tools.enunciate.modules.openapi.enumeration; | ||
|
||
import javax.xml.bind.annotation.XmlEnum; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import javax.xml.bind.annotation.XmlType; | ||
|
||
@XmlRootElement(name="xmlRootElementRoleType") | ||
@XmlType(name="xmlTypeRoleType") | ||
@XmlEnum | ||
public enum RootElementEnum { | ||
ADMIN, | ||
MONITOR | ||
} |
13 changes: 13 additions & 0 deletions
13
src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/enumeration/enunciate.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<enunciate version="version from enunciate.xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.11.1.xsd"> | ||
<title>Title from enunciate.xml</title> | ||
<description>Description from enunciate.xml. Can contain weird letters æøåÆØÅ</description> | ||
|
||
<modules disabledByDefault="true"> | ||
<openapi disabled="false" skipBase="false" /> | ||
<jaxrs groupBy="class" disabled="false" /> | ||
<jackson disabled="false" /> | ||
<jaxb disabled="false" /> | ||
<jaxrs disabled="false" /> | ||
</modules> | ||
</enunciate> |
66 changes: 66 additions & 0 deletions
66
src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/enumeration/openapi.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: "Title from enunciate.xml" | ||
version: "version from enunciate.xml" | ||
description: "Description from enunciate.xml. Can contain weird letters æøåÆØÅ" | ||
servers: [] | ||
paths: | ||
"/path/ref": | ||
get: | ||
description: "" | ||
tags: | ||
- "DataResource" | ||
summary: "" | ||
deprecated: false | ||
operationId: getReferenceEnum | ||
responses: | ||
"200": | ||
description: "" | ||
content: | ||
"*/*": | ||
schema: | ||
$ref: "#/components/schemas/xml_ns0_dataXmlDTO" | ||
|
||
"/path/root": | ||
get: | ||
description: "" | ||
tags: | ||
- "DataResource" | ||
summary: "" | ||
deprecated: false | ||
operationId: getRootElementEnum | ||
responses: | ||
"200": | ||
description: "" | ||
content: | ||
"*/*": | ||
schema: | ||
$ref: "#/components/schemas/xml_ns0_xmlTypeRoleType" | ||
|
||
components: | ||
schemas: | ||
"xml_ns0_dataXmlDTO": | ||
title: "dataXmlDTO" | ||
allOf: | ||
- type: string | ||
format: binary | ||
- type: object | ||
properties: | ||
user: | ||
$ref: "#/components/schemas/xml_ns0_referenceEnum" | ||
xml: | ||
name: dataXmlDto | ||
"xml_ns0_referenceEnum": | ||
title: "referenceEnum" | ||
type: string | ||
enum: | ||
- REF_1 | ||
- REF_2 | ||
"xml_ns0_xmlTypeRoleType": | ||
title: "xmlTypeRoleType" | ||
type: string | ||
enum: | ||
- ADMIN | ||
- MONITOR | ||
xml: | ||
name: xmlRootElementRoleType |