Skip to content

Commit

Permalink
stoicflame#32 Added end to end test for EnunciateTestsGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
mengjiann committed Aug 25, 2020
1 parent 6ea281c commit 688de47
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package dk.jyskebank.tools.enunciate.modules.openapi.confignamespacewithprefix;

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")
public class DataResource {

@TypeHint(DataXmlDTO.class)
@GET
@Path("/xmldto")
@Produces(MediaType.APPLICATION_XML)
public Response getXmlType() {
return Response.ok(new DataXmlDTO()).build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package dk.jyskebank.tools.enunciate.modules.openapi.confignamespacewithprefix;

import javax.xml.bind.annotation.*;

@XmlType(name = "dataXmlDTO", namespace = "http://www.jyskebank.dk/enunciate/openapi/version/1")
@XmlRootElement(name="dataXmlDTO", namespace = "http://www.jyskebank.dk/enunciate/openapi/version/1")
@XmlAccessorType(XmlAccessType.FIELD)
public class DataXmlDTO {
@XmlElement(name="aString")
private String aString;

@XmlElement
private DataXmlEnum anEnum;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package dk.jyskebank.tools.enunciate.modules.openapi.confignamespacewithprefix;

import javax.xml.bind.annotation.XmlEnum;

@XmlEnum
public enum DataXmlEnum {
GOOD,
MORNING;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package dk.jyskebank.tools.enunciate.modules.openapi.confignamespacewithprefix;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@ApplicationPath("rest")
public class RestApplication extends Application {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<enunciate version="version" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.11.1.xsd">

<namespaces>
<namespace uri="http://www.jyskebank.dk/enunciate/openapi/version/1" id="prefix-a"/>
</namespaces>

<modules disabledByDefault="true">
<openapi disabled="false" skipBase="false" />
<jaxrs groupBy="class" disabled="false" />
<jackson disabled="false" />
<jaxb disabled="false" />
</modules>
</enunciate>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
openapi: 3.0.0
info:
title: "Web Service API"
version: "version"
description: ""
servers: []
paths:
"/path/xmldto":
get:
description: ""
tags:
- "DataResource"
summary: ""
deprecated: false
operationId: getXmlType
responses:
"200":
description: ""
content:
"*/*":
schema:
$ref: "#/components/schemas/xml_prefix-a_dataXmlDTO"

components:
schemas:
"xml_ns0_dataXmlEnum":
title: "dataXmlEnum"
type: string
enum:
- "GOOD"
- "MORNING"
"xml_prefix-a_dataXmlDTO":
title: "dataXmlDTO"
allOf:
- type: string
format: binary
- type: object
properties:
"aString":
type: string
"anEnum":
$ref: "#/components/schemas/xml_ns0_dataXmlEnum"
xml:
name: dataXmlDTO
namespace: http://www.jyskebank.dk/enunciate/openapi/version/1
prefix: prefix-a

0 comments on commit 688de47

Please sign in to comment.