Commit 9839849a authored by Christos Tranoris's avatar Christos Tranoris
Browse files

tests

parent 5655f069
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@
	<artifactId>org.etsi.osl.tmf.api</artifactId>
	<name>org.etsi.osl.tmf.api</name>

	<version>${org.etsi.osl.tmf.api.version>}</version>


	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+61 −25
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	             
@@ -109,7 +109,7 @@ public class SwaggerDocumentationConfig {
	            		  .description("## TMF API Reference: TMF620 - Product Catalog Management  ### Release : 19.0 - June 2019  Product Catalog API is one of Catalog Management API Family. Product Catalog API goal is to provide a catalog of products.   ### Operations Product Catalog API performs the following operations on the resources : - Retrieve an entity or a collection of entities depending on filter criteria - Partial update of an entity (including updating rules) - Create an entity (including default values and creation rules) - Delete an entity - Manage notification of events")
	                      
		              .version("4.0.0")
		              .license(new License().name("Apache 2.0").url("http://openslice.io")))
		              .license(new License().name("Apache 2.0").url("https://osl.etsi.org")))
					.externalDocs(new ExternalDocumentation()
							.description("TMF API Tables")
							.url("https://www.tmforum.org/oda/open-apis/table"));	     
@@ -139,7 +139,7 @@ public class SwaggerDocumentationConfig {
  
  
	@Bean
	public OpenApiCustomizer scm622OpenAPI() {
	public OpenApiCustomizer po622OpenAPI() {
		return openApi -> openApi
				.specVersion( SpecVersion.V30 ).addSecurityItem(new SecurityRequirement().addList("security_auth")) 
				.info(new Info().title("TMF 622 Product Ordering")
@@ -148,7 +148,7 @@ public class SwaggerDocumentationConfig {
						.version("1.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -161,13 +161,49 @@ public class SwaggerDocumentationConfig {
	  	SpringDocUtils.getConfig().replaceWithClass(java.time.OffsetDateTime.class, java.util.Date.class);
      return GroupedOpenApi.builder()
      		.group("tmf-api-622-ProductOrderingManagement-v4.0.0")
      		.addOpenApiCustomizer( this.scm622OpenAPI() )
      		.addOpenApiCustomizer( this.po622OpenAPI() )
      		.packagesToScan("org.etsi.osl.tmf.po622.api")
      		.build();

  }
	
  
  /**
   * TMF 637 Product Inventory Management 
   * @return
   */
  @Bean
  public OpenApiCustomizer pim637penAPI() {
      
      
      return openApi -> openApi
              .specVersion( SpecVersion.V30 ).addSecurityItem(new SecurityRequirement().addList("security_auth")) 
                .info(new Info().title("TMF 637 Product Inventory Management")
                    .description("**TMF API Reference : TMF 637 - Product Inventory Management**  Release : 19.0 - June 2019\n\nThe Product Inventory Management API provides standardized mechanism for product inventory management such as creation, update and retrieval of the representation of a product in the inventory. It also allows the notification of events related to product lifecycle  **Product resource** A product offering procured by a customer or other interested party playing a party role. A product is realized as one or more service(s) and / or resource(s).  Product Inventory API performs the following operations on product : - Retrieval of a product or a collection of products depending on filter criteria - Partial update of a product (including updating rules and for administration purpose) - Creation of a product (including default values and creation rules and for administration purpose) - Deletion of a product (for administration purposes) - Notification of events on product.  Copyright © TM Forum 2019. All Rights Reserved   ")
                    
                    .version("4.0.0")
                    .license(new License().name("Apache 2.0").url("https://osl.etsi.org")))
                  .externalDocs(new ExternalDocumentation()
                          .description("TMF API Tables")
                          .url("https://www.tmforum.org/oda/open-apis/table"));        
                       
    }
  
  
@Bean
public GroupedOpenApi pim637() {

      SpringDocUtils.getConfig().replaceWithClass(java.time.LocalDate.class, java.sql.Date.class);
      SpringDocUtils.getConfig().replaceWithClass(java.time.OffsetDateTime.class, java.util.Date.class);
    return GroupedOpenApi.builder()
          .group("tmf-api-637-ProductInventoryManagement-v4.0.0")
          .addOpenApiCustomizer( this.pim637penAPI() )
          .packagesToScan("org.etsi.osl.tmf.pim637.api")
          .build();

}

	  
  /**
	 * TMF 634 Resource Catalog Management
	 * @return
@@ -183,7 +219,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -217,7 +253,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -255,7 +291,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -291,7 +327,7 @@ public class SwaggerDocumentationConfig {
						.version("2.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -328,7 +364,7 @@ public class SwaggerDocumentationConfig {
						.version("2.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -366,7 +402,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -403,7 +439,7 @@ public class SwaggerDocumentationConfig {
						.version("2.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -442,7 +478,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -479,7 +515,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -516,7 +552,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -555,7 +591,7 @@ public class SwaggerDocumentationConfig {
//			            .version("3.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -594,7 +630,7 @@ public class SwaggerDocumentationConfig {
			            .version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -633,7 +669,7 @@ public class SwaggerDocumentationConfig {
			            .version("1.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -671,7 +707,7 @@ public class SwaggerDocumentationConfig {
			            .version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -709,7 +745,7 @@ public class SwaggerDocumentationConfig {
			            .version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));	  	                  
@@ -744,7 +780,7 @@ public class SwaggerDocumentationConfig {
						.version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("TMF API Tables")
						.url("https://www.tmforum.org/oda/open-apis/table"));
@@ -781,10 +817,10 @@ public class SwaggerDocumentationConfig {
			            .version("4.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("Openslice")
						.url("http://openslice.io"));	  	                  
						.url("https://osl.etsi.org"));	  	                  
	  }
	
	@Bean
@@ -826,10 +862,10 @@ public class SwaggerDocumentationConfig {
			            .version("1.0.0")
						.license(new License()
								.name("Apache 2.0")
								.url("http://openslice.io")))
								.url("https://osl.etsi.org")))
				.externalDocs(new ExternalDocumentation()
						.description("Openslice")
						.url("http://openslice.io"));	  	                  
						.url("https://osl.etsi.org"));	  	                  
	  }
	
	@Bean
+10 −0
Original line number Diff line number Diff line
package org.etsi.osl.tmf.pim637.api;

@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
public class ApiException extends Exception {
    private int code;
    public ApiException (int code, String msg) {
        super(msg);
        this.code = code;
    }
}
+30 −0
Original line number Diff line number Diff line
package org.etsi.osl.tmf.pim637.api;

import java.io.IOException;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletResponse;

@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
public class ApiOriginFilter implements jakarta.servlet.Filter {
    @Override
    public void doFilter(ServletRequest request, ServletResponse response,
            FilterChain chain) throws IOException, ServletException {
        HttpServletResponse res = (HttpServletResponse) response;
        res.addHeader("Access-Control-Allow-Origin", "*");
        res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
        res.addHeader("Access-Control-Allow-Headers", "Content-Type");
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {
    }

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
    }
}
+69 −0
Original line number Diff line number Diff line
package org.etsi.osl.tmf.pim637.api;

import jakarta.xml.bind.annotation.XmlTransient;

@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]")
@jakarta.xml.bind.annotation.XmlRootElement
public class ApiResponseMessage {
    public static final int ERROR = 1;
    public static final int WARNING = 2;
    public static final int INFO = 3;
    public static final int OK = 4;
    public static final int TOO_BUSY = 5;

    int code;
    String type;
    String message;

    public ApiResponseMessage(){}

    public ApiResponseMessage(int code, String message){
        this.code = code;
        switch(code){
        case ERROR:
            setType("error");
            break;
        case WARNING:
            setType("warning");
            break;
        case INFO:
            setType("info");
            break;
        case OK:
            setType("ok");
            break;
        case TOO_BUSY:
            setType("too busy");
            break;
        default:
            setType("unknown");
            break;
        }
        this.message = message;
    }

    @XmlTransient
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
Loading