Remove rApp Catalogue 61/7761/1
authorelinuxhenrik <henrik.b.andersson@est.tech>
Thu, 17 Feb 2022 15:28:01 +0000 (16:28 +0100)
committerelinuxhenrik <henrik.b.andersson@est.tech>
Thu, 17 Feb 2022 15:28:06 +0000 (16:28 +0100)
Issue-ID: NONRTRIC-717
Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
Change-Id: I5d6c621bd43f6482d768be37b360cb4a950cad7c

25 files changed:
docs/api-docs.rst
docs/conf.py
docs/developer-guide.rst
docs/overview.rst
docs/release-notes.rst
docs/requirements-docs.txt
pom.xml
r-app-catalogue/.gitignore [deleted file]
r-app-catalogue/Dockerfile [deleted file]
r-app-catalogue/README.md [deleted file]
r-app-catalogue/api/rac-api.json [deleted file]
r-app-catalogue/api/rac-api.yaml [deleted file]
r-app-catalogue/config/application.yaml [deleted file]
r-app-catalogue/config/r-app-catalogue-keystore.jks [deleted file]
r-app-catalogue/eclipse-formatter.xml [deleted file]
r-app-catalogue/pom.xml [deleted file]
r-app-catalogue/src/main/java/org/oransc/rappcatalogue/api/GeneralRappCatalogueControllerAdvisor.java [deleted file]
r-app-catalogue/src/main/java/org/oransc/rappcatalogue/api/ServicesApiDelegateImpl.java [deleted file]
r-app-catalogue/src/main/java/org/oransc/rappcatalogue/configuration/TomcatConfig.java [deleted file]
r-app-catalogue/src/main/java/org/oransc/rappcatalogue/exception/HeaderException.java [deleted file]
r-app-catalogue/src/main/java/org/oransc/rappcatalogue/exception/InvalidServiceException.java [deleted file]
r-app-catalogue/src/main/java/org/oransc/rappcatalogue/exception/ServiceNotFoundException.java [deleted file]
r-app-catalogue/src/test/java/org/oransc/rappcatalogue/HttpsRequestTest.java [deleted file]
r-app-catalogue/src/test/java/org/oransc/rappcatalogue/api/GeneralRappCatalogueControllerAdvisorTest.java [deleted file]
r-app-catalogue/src/test/java/org/oransc/rappcatalogue/api/ServicesApiDelegateImplTest.java [deleted file]

index 29207b8..b87b789 100644 (file)
@@ -22,7 +22,6 @@ The core Non-RT RIC consists of several parts, with available APIs described in
 * The A1 Policy Management Service
 * The Information Coordinator Service
 * DMaaP Adaptor
-* The Non-RT-RIC App Catalogue
 * K8S Helm Chart LCM Manager (Initial) **<ToDo>**
 
 A1 Policy Management Service
@@ -75,22 +74,6 @@ The API is also described in Swagger-JSON and YAML:
 
    "DMaaP Mediator Producer API", ":download:`link <../dmaap-mediator-producer/api/swagger.json>`", ":download:`link <../dmaap-mediator-producer/api/swagger.yaml>`"
 
-Non-RT-RIC App Catalogue (Initial)
-==================================
-
-The Service Catalogue provides a way for services to register themselves for other services to discover.
-
-See `Service Catalogue API <./rac-api.html>`_ for full details of the API.
-
-The API is also described in Swagger-JSON and YAML:
-
-
-.. csv-table::
-   :header: "API name", "|swagger-icon|", "|yaml-icon|"
-   :widths: 10,5, 5
-
-   "Service Catalogue API", ":download:`link <../r-app-catalogue/api/rac-api.json>`", ":download:`link <../r-app-catalogue/api/rac-api.yaml>`"
-
 K8S Helm Chart LCM Manager (Initial)
 ====================================
 
index 4ee6998..87a9b71 100644 (file)
@@ -8,21 +8,14 @@ linkcheck_ignore = [
     'http://localhost.*',
     'http://127.0.0.1.*',
     'https://gerrit.o-ran-sc.org.*',
-    './rac-api.html', #Generated file that doesn't exist at link check.
     './ics-api.html', #Generated file that doesn't exist at link check.
-    './dmaap-adaptor-api.html' #Generated file that doesn't exist at link check.
+    './dmaap-adaptor-api.html', #Generated file that doesn't exist at link check.
     './dmaap-mediator-producer-api.html' #Generated file that doesn't exist at link check.
 ]
 
 extensions = ['sphinxcontrib.redoc', 'sphinx.ext.intersphinx',]
 
 redoc = [
-            {
-                'name': 'RAC API',
-                'page': 'rac-api',
-                'spec': '../r-app-catalogue/api/rac-api.json',
-                'embed': True,
-            },
             {
                 'name': 'ICS API',
                 'page': 'ics-api',
index a3c3422..af206e7 100644 (file)
@@ -58,11 +58,6 @@ Then start the container by running the following command:
     | docker run nonrtric-information-coordinator-service                |
     +--------------------------------------------------------------------+
 
-Initial Non-RT-RIC App Catalogue
---------------------------------
-
-See the README.md file in the *r-app-catalogue* directory in the Gerrit repo for more details how to run the component.
-
 DMaaP Adaptor Service
 ---------------------
 
index 19194f4..f598d5a 100644 (file)
@@ -195,6 +195,9 @@ Register for Non-RT-RIC Apps.
 * Non-RT-RIC Apps can be registered / queried.
 * Limited functionality/integration for now.
 * *More work required in coming releases as the rApp concept matures*.
+* Repo: *portal/nonrtric-plt-rappcatalogue*
+
+More details available at the `documentation site <https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-rappcatalogue>`_.
 
 Initial K8S Helm Chart LCM Manager
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 81fb035..3e8dc26 100644 (file)
@@ -76,23 +76,6 @@ Version history Information Coordinator Service
 +------------+----------+------------------+--------------------+
 
 
-Version history Service Catalogue
-=================================
-
-+------------+----------+------------------+----------------+
-| **Date**   | **Ver.** | **Author**       | **Comment**    |
-|            |          |                  |                |
-+------------+----------+------------------+----------------+
-| 2020-12-03 | 1.0.0    | Henrik Andersson | Cherry Release |
-|            |          |                  |                |
-+------------+----------+------------------+----------------+
-| 2020-12-03 | 1.0.2    | Henrik Andersson | E Maintenance  |
-|            |          |                  | Release        |
-|            |          |                  | Non root user  |
-|            |          |                  | in Docker      |
-+------------+----------+------------------+----------------+
-
-
 Version history Helm Manager
 ============================
 
index 78db685..692a79f 100644 (file)
@@ -1,11 +1,11 @@
 tox
-Sphinx>=2,<4
+Sphinx
 doc8
 docutils
 setuptools
 six
-sphinx_rtd_theme>=0.4.3
-sphinxcontrib-needs>=0.2.3
+sphinx_rtd_theme
+sphinxcontrib-needs
 sphinxcontrib-swaggerdoc
 sphinx_bootstrap_theme
 sphinxcontrib-redoc
diff --git a/pom.xml b/pom.xml
index 1a7d888..3ec1617 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,6 @@
     <modules>
         <module>a1-policy-management-service</module>
         <module>information-coordinator-service</module>
-        <module>r-app-catalogue</module>
         <module>helm-manager</module>
         <module>dmaap-adaptor-java</module>
     </modules>
diff --git a/r-app-catalogue/.gitignore b/r-app-catalogue/.gitignore
deleted file mode 100644 (file)
index ad56f2d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-.swagger-codegen-ignore
-.swagger-codegen/
-api/README.md
diff --git a/r-app-catalogue/Dockerfile b/r-app-catalogue/Dockerfile
deleted file mode 100644 (file)
index ed4be95..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2020 Nordix Foundation.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-#
-FROM openjdk:11-jre-slim
-
-ARG JAR
-
-WORKDIR /opt/app/r-app-catalogue
-RUN mkdir -p /var/log/r-app-catalogue
-RUN mkdir -p /opt/app/r-app-catalogue/etc/cert/
-
-EXPOSE 8680 8633
-
-ADD /config/application.yaml /opt/app/r-app-catalogue/config/application.yaml
-ADD /config/r-app-catalogue-keystore.jks /opt/app/r-app-catalogue/etc/cert/keystore.jks
-ADD target/${JAR} /opt/app/r-app-catalogue/r-app-catalogue.jar
-
-ARG user=nonrtric
-ARG group=nonrtric
-
-RUN groupadd $user && \
-    useradd -r -g $group $user
-RUN chown -R $user:$group /opt/app/r-app-catalogue
-RUN chown -R $user:$group /var/log/r-app-catalogue
-
-USER ${user}
-
-CMD ["java", "-jar", "/opt/app/r-app-catalogue/r-app-catalogue.jar"]
-
-
-
-
diff --git a/r-app-catalogue/README.md b/r-app-catalogue/README.md
deleted file mode 100644 (file)
index 863713d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# O-RAN-SC Non-RT RIC rAPP Catalogue
-
-The O-RAN Non-RT RIC rApp Catalogue provides an OpenApi 3.0 REST API for services to register themselves and discover
-other services.
-
-**NOTE!** The definition of the REST API is done in the `api/rac-api.json` file. The yaml version of the file is
-generated during compilation.
-
-The application is a SpringBoot application generated using the openapitools openapi-generator-maven-plugin.
-
-To start the application run:
-`mvn spring-boot:run`
-
-## License
-
-Copyright (C) 2020 Nordix Foundation. All rights reserved.
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/r-app-catalogue/api/rac-api.json b/r-app-catalogue/api/rac-api.json
deleted file mode 100644 (file)
index 64f19d8..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-{
-    "openapi": "3.0.0",
-    "info": {
-        "title": "rAPP Catalogue API",
-        "description": "The Non RT-RIC Service Catalogue provides a way for services to register themselves for other services to discover.",
-        "version": "1.0.0"
-    },
-    "servers": [
-        {
-            "url": "/"
-        }
-    ],
-    "paths": {
-        "/services": {
-            "get": {
-                "summary": "Services",
-                "deprecated": false,
-                "operationId": "getServices",
-                "responses": {
-                    "200": {
-                        "description": "Services",
-                        "content": {
-                            "application/json": {
-                                "schema": {
-                                    "type": "array",
-                                    "items": {
-                                        "$ref": "#/components/schemas/service"
-                                    }
-                                }
-                            }
-                        }
-                    }
-                },
-                "tags": [
-                    "rAPP Catalogue API"
-                ]
-            }
-        },
-        "/services/{serviceName}": {
-            "get": {
-                "summary": "Individual Service",
-                "deprecated": false,
-                "operationId": "getIndividualService",
-                "responses": {
-                    "200": {
-                        "description": "Service",
-                        "content": {
-                            "application/json": {
-                                "schema": {
-                                    "$ref": "#/components/schemas/service"
-                                }
-                            }
-                        }
-                    },
-                    "404": {
-                        "description": "Service is not found",
-                        "content": {
-                            "application/json": {
-                                "schema": {
-                                    "$ref": "#/components/schemas/error_information"
-                                }
-                            }
-                        }
-                    }
-                },
-                "parameters": [
-                    {
-                        "in": "path",
-                        "name": "serviceName",
-                        "description": "serviceName",
-                        "schema": {
-                            "type": "string"
-                        },
-                        "required": true,
-                        "example": "DroneIdentifier"
-                    }
-                ],
-                "tags": [
-                    "rAPP Catalogue API"
-                ]
-            },
-            "put": {
-                "summary": "Create or update a Service",
-                "deprecated": false,
-                "operationId": "putIndividualService",
-                "responses": {
-                    "200": {
-                        "description": "Service updated"
-                    },
-                    "201": {
-                        "description": "Service created",
-                        "headers": {
-                            "Location": {
-                                "schema": {
-                                    "type": "string"
-                                },
-                                "description": "URL to the created Service"
-                            }
-                        }
-                    },
-                    "400": {
-                        "description": "Provided service is not correct",
-                        "content": {
-                            "application/json": {
-                                "schema": {
-                                    "$ref": "#/components/schemas/error_information"
-                                },
-                                "example": {
-                                    "detail": "Service is missing required property: version",
-                                    "status": 400
-                                }
-                            }
-                        }
-                    }
-                },
-                "parameters": [
-                    {
-                        "name": "serviceName",
-                        "in": "path",
-                        "required": true,
-                        "schema": {
-                            "type": "string"
-                        },
-                        "example": "DroneIdentifier"
-                    }
-                ],
-                "requestBody": {
-                    "description": "Service to create/update",
-                    "required": true,
-                    "content": {
-                        "application/json": {
-                            "schema": {
-                                "$ref": "#/components/schemas/inputService"
-                            }
-                        }
-                    }
-                },
-                "tags": [
-                    "rAPP Catalogue API"
-                ]
-            },
-            "delete": {
-                "summary": "Remove a Service from the catalogue",
-                "deprecated": false,
-                "operationId": "deleteIndividualService",
-                "responses": {
-                    "204": {
-                        "description": "Service deleted"
-                    }
-                },
-                "parameters": [
-                    {
-                        "name": "serviceName",
-                        "in": "path",
-                        "required": true,
-                        "schema": {
-                            "type": "string"
-                        },
-                        "example": "DroneIdentifier"
-                    }
-                ],
-                "tags": [
-                    "rAPP Catalogue API"
-                ]
-            }
-        }
-    },
-    "components": {
-        "schemas": {
-            "inputService": {
-                "description": "A Service to register",
-                "type": "object",
-                "title": "inputService",
-                "required": [
-                    "version"
-                ],
-                "properties": {
-                    "version": {
-                        "description": "Version of the Service",
-                        "type": "string",
-                        "example": "1.0.0"
-                    },
-                    "display_name": {
-                        "description": "Display name for the Service",
-                        "type": "string",
-                        "example": "Drone Identifier"
-                    },
-                    "description": {
-                        "description": "Description of the Service",
-                        "type": "string",
-                        "example": "Detects if a UE is a drone"
-                    }
-                }
-            },
-            "service": {
-                "description": "A Service",
-                "type": "object",
-                "title": "service",
-                "required": [
-                    "name",
-                    "version",
-                    "registrationDate"
-                ],
-                "properties": {
-                    "name": {
-                        "description": "Unique identifier of the Service",
-                        "type": "string",
-                        "example": "DroneIdentifier"
-                    },
-                    "version": {
-                        "description": "Version of the Service",
-                        "type": "string",
-                        "example": "1.0.0"
-                    },
-                    "display_name": {
-                        "description": "Display name for the Service",
-                        "type": "string",
-                        "example": "Drone Identifier"
-                    },
-                    "description": {
-                        "description": "Description of the Service",
-                        "type": "string",
-                        "example": "Detects if a UE is a drone"
-                    },
-                    "registrationDate": {
-                        "description": "Date when the Service was registered in the catalogue",
-                        "type": "string",
-                        "example": "2020-11-03"
-                    }
-                }
-            },
-            "error_information": {
-                "description": "Problem as defined in https://tools.ietf.org/html/rfc7807",
-                "type": "object",
-                "title": "error_information",
-                "properties": {
-                    "detail": {
-                        "description": "A human-readable explanation specific to this occurrence of the problem.",
-                        "type": "string",
-                        "example": "Service not found"
-                    },
-                    "status": {
-                        "format": "int32",
-                        "description": "The HTTP status code for this occurrence of the problem.",
-                        "type": "integer",
-                        "example": 404
-                    }
-                }
-            }
-        }
-    }
-}
diff --git a/r-app-catalogue/api/rac-api.yaml b/r-app-catalogue/api/rac-api.yaml
deleted file mode 100644 (file)
index 9ba6c39..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-openapi: 3.0.0
-info:
-  title: rAPP Catalogue API
-  description: The Non RT-RIC Service Catalogue provides a way for services to register
-    themselves for other services to discover.
-  version: 1.0.0
-servers:
-- url: /
-paths:
-  /services:
-    get:
-      tags:
-      - rAPP Catalogue API
-      summary: Services
-      operationId: getServices
-      responses:
-        "200":
-          description: Services
-          content:
-            application/json:
-              schema:
-                type: array
-                items:
-                  $ref: '#/components/schemas/service'
-      deprecated: false
-  /services/{serviceName}:
-    get:
-      tags:
-      - rAPP Catalogue API
-      summary: Individual Service
-      operationId: getIndividualService
-      parameters:
-      - name: serviceName
-        in: path
-        description: serviceName
-        required: true
-        style: simple
-        explode: false
-        schema:
-          type: string
-        example: DroneIdentifier
-      responses:
-        "200":
-          description: Service
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/service'
-        "404":
-          description: Service is not found
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/error_information'
-      deprecated: false
-    put:
-      tags:
-      - rAPP Catalogue API
-      summary: Create or update a Service
-      operationId: putIndividualService
-      parameters:
-      - name: serviceName
-        in: path
-        required: true
-        style: simple
-        explode: false
-        schema:
-          type: string
-        example: DroneIdentifier
-      requestBody:
-        description: Service to create/update
-        content:
-          application/json:
-            schema:
-              $ref: '#/components/schemas/inputService'
-        required: true
-      responses:
-        "200":
-          description: Service updated
-        "201":
-          description: Service created
-          headers:
-            Location:
-              description: URL to the created Service
-              style: simple
-              explode: false
-              schema:
-                type: string
-        "400":
-          description: Provided service is not correct
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/error_information'
-              example:
-                detail: "Service is missing required property: version"
-                status: 400
-      deprecated: false
-    delete:
-      tags:
-      - rAPP Catalogue API
-      summary: Remove a Service from the catalogue
-      operationId: deleteIndividualService
-      parameters:
-      - name: serviceName
-        in: path
-        required: true
-        style: simple
-        explode: false
-        schema:
-          type: string
-        example: DroneIdentifier
-      responses:
-        "204":
-          description: Service deleted
-      deprecated: false
-components:
-  schemas:
-    inputService:
-      title: inputService
-      required:
-      - version
-      type: object
-      properties:
-        version:
-          type: string
-          description: Version of the Service
-          example: 1.0.0
-        display_name:
-          type: string
-          description: Display name for the Service
-          example: Drone Identifier
-        description:
-          type: string
-          description: Description of the Service
-          example: Detects if a UE is a drone
-      description: A Service to register
-    service:
-      title: service
-      required:
-      - name
-      - registrationDate
-      - version
-      type: object
-      properties:
-        name:
-          type: string
-          description: Unique identifier of the Service
-          example: DroneIdentifier
-        version:
-          type: string
-          description: Version of the Service
-          example: 1.0.0
-        display_name:
-          type: string
-          description: Display name for the Service
-          example: Drone Identifier
-        description:
-          type: string
-          description: Description of the Service
-          example: Detects if a UE is a drone
-        registrationDate:
-          type: string
-          description: Date when the Service was registered in the catalogue
-          example: 2020-11-03
-      description: A Service
-    error_information:
-      title: error_information
-      type: object
-      properties:
-        detail:
-          type: string
-          description: A human-readable explanation specific to this occurrence of
-            the problem.
-          example: Service not found
-        status:
-          type: integer
-          description: The HTTP status code for this occurrence of the problem.
-          format: int32
-          example: 404
-      description: Problem as defined in https://tools.ietf.org/html/rfc7807
diff --git a/r-app-catalogue/config/application.yaml b/r-app-catalogue/config/application.yaml
deleted file mode 100644 (file)
index 1ef0bdc..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
- # ========================LICENSE_START=================================
- # Copyright (C) 2021 Nordix Foundation. All rights reserved.
- # ======================================================================
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- #      http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- # ========================LICENSE_END===================================
-
-spring:
-  profiles:
-    active: prod
-server:
-   # Configuration of the HTTP/REST server. The parameters are defined and handled by the springboot framework.
-   # See springboot documentation.
-   port : 8633
-   http-port: 8680
-   ssl:
-      key-store-type: JKS
-      key-store: /opt/app/r-app-catalogue/etc/cert/keystore.jks
-      key-store-password: r-app-catalogue
-      key-password: r-app-catalogue
-      key-alias: server-cert
diff --git a/r-app-catalogue/config/r-app-catalogue-keystore.jks b/r-app-catalogue/config/r-app-catalogue-keystore.jks
deleted file mode 100644 (file)
index 192fe17..0000000
Binary files a/r-app-catalogue/config/r-app-catalogue-keystore.jks and /dev/null differ
diff --git a/r-app-catalogue/eclipse-formatter.xml b/r-app-catalogue/eclipse-formatter.xml
deleted file mode 100644 (file)
index c8cca2e..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2019 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
-  -->
-<profiles version="13">
-<profile kind="CodeFormatterProfile" name="java-formatter" version="12">
-<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
-<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
-<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
-<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="48"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
-<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
-<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
-</profile>
-</profiles>
diff --git a/r-app-catalogue/pom.xml b/r-app-catalogue/pom.xml
deleted file mode 100644 (file)
index 67be912..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-* ========================LICENSE_START=================================\r
-* O-RAN-SC\r
-* %%\r
-* Copyright (C) 2020 Nordix Foundation\r
-* %%\r
-* Licensed under the Apache License, Version 2.0 (the "License");\r
-* you may not use this file except in compliance with the License.\r
-* You may obtain a copy of the License at\r
-*\r
-* http://www.apache.org/licenses/LICENSE-2.0\r
-*\r
-* Unless required by applicable law or agreed to in writing, software\r
-* distributed under the License is distributed on an "AS IS" BASIS,\r
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-* See the License for the specific language governing permissions and\r
-* limitations under the License.\r
-* ========================LICENSE_END===================================\r
--->\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">\r
-    <modelVersion>4.0.0</modelVersion>\r
-\r
-    <parent>\r
-        <groupId>org.springframework.boot</groupId>\r
-        <artifactId>spring-boot-starter-parent</artifactId>\r
-        <version>2.6.2</version>\r
-        <relativePath />\r
-    </parent>\r
-    <groupId>org.o-ran-sc.nonrtric</groupId>\r
-    <artifactId>r-app-catalogue</artifactId>\r
-    <version>1.1.0-SNAPSHOT</version>\r
-    <licenses>\r
-        <license>\r
-            <name>The Apache Software License, Version 2.0</name>\r
-            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>\r
-        </license>\r
-    </licenses>\r
-    <properties>\r
-        <java.version>11</java.version>\r
-        <swagger-annotations.version>1.5.22</swagger-annotations.version>\r
-        <springfox.version>2.9.2</springfox.version>\r
-        <jackson-databind-nullable.version>0.2.1</jackson-databind-nullable.version>\r
-        <openapi-generator-maven-plugin.version>5.3.1</openapi-generator-maven-plugin.version>\r
-        <swagger-codegen-maven-plugin.version>3.0.31</swagger-codegen-maven-plugin.version>\r
-        <formatter-maven-plugin.version>2.12.2</formatter-maven-plugin.version>\r
-        <spotless-maven-plugin.version>1.24.3</spotless-maven-plugin.version>\r
-        <jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>\r
-        <docker-maven-plugin.version>0.30.0</docker-maven-plugin.version>\r
-    </properties>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>io.swagger</groupId>\r
-            <artifactId>swagger-annotations</artifactId>\r
-            <version>${swagger-annotations.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>com.fasterxml.jackson.core</groupId>\r
-            <artifactId>jackson-annotations</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-beans</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.boot</groupId>\r
-            <artifactId>spring-boot-autoconfigure</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-web</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.boot</groupId>\r
-            <artifactId>spring-boot</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-webmvc</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-context</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>io.springfox</groupId>\r
-            <artifactId>springfox-swagger2</artifactId>\r
-            <version>${springfox.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>io.springfox</groupId>\r
-            <artifactId>springfox-core</artifactId>\r
-            <version>${springfox.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>io.springfox</groupId>\r
-            <artifactId>springfox-spring-web</artifactId>\r
-            <version>${springfox.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>io.springfox</groupId>\r
-            <artifactId>springfox-spi</artifactId>\r
-            <version>${springfox.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.assertj</groupId>\r
-            <artifactId>assertj-core</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.apache.tomcat.embed</groupId>\r
-            <artifactId>tomcat-embed-core</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.openapitools</groupId>\r
-            <artifactId>jackson-databind-nullable</artifactId>\r
-            <version>${jackson-databind-nullable.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>javax.validation</groupId>\r
-            <artifactId>validation-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>com.fasterxml.jackson.core</groupId>\r
-            <artifactId>jackson-databind</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.yaml</groupId>\r
-            <artifactId>snakeyaml</artifactId>\r
-            <scope>runtime</scope>\r
-        </dependency>\r
-        <!-- TEST -->\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-test</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.junit.jupiter</groupId>\r
-            <artifactId>junit-jupiter-api</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.mockito</groupId>\r
-            <artifactId>mockito-junit-jupiter</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.mockito</groupId>\r
-            <artifactId>mockito-core</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.junit.jupiter</groupId>\r
-            <artifactId>junit-jupiter-engine</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.boot</groupId>\r
-            <artifactId>spring-boot-starter-test</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.apache.httpcomponents</groupId>\r
-            <artifactId>httpclient</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-\r
-    </dependencies>\r
-\r
-    <build>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.springframework.boot</groupId>\r
-                <artifactId>spring-boot-maven-plugin</artifactId>\r
-            </plugin>\r
-            <plugin>\r
-                <groupId>org.openapitools</groupId>\r
-                <artifactId>openapi-generator-maven-plugin</artifactId>\r
-                <version>${openapi-generator-maven-plugin.version}</version>\r
-                <executions>\r
-                    <execution>\r
-                        <goals>\r
-                            <goal>generate</goal>\r
-                        </goals>\r
-                        <configuration>\r
-                            <inputSpec>${project.basedir}/api/rac-api.json</inputSpec>\r
-                            <generatorName>spring</generatorName>\r
-                            <apiPackage>org.oransc.rappcatalogue.api</apiPackage>\r
-                            <modelPackage>org.oransc.rappcatalogue.model</modelPackage>\r
-                            <invokerPackage>org.oransc.rappcatalogue</invokerPackage>\r
-                            <configOptions>\r
-                                <delegatePattern>true</delegatePattern>\r
-                                <unhandledException>true</unhandledException>\r
-                            </configOptions>\r
-                        </configuration>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-            <plugin>\r
-                <groupId>io.swagger.codegen.v3</groupId>\r
-                <artifactId>swagger-codegen-maven-plugin</artifactId>\r
-                <version>${swagger-codegen-maven-plugin.version}</version>\r
-                <executions>\r
-                    <execution>\r
-                        <goals>\r
-                            <goal>generate</goal>\r
-                        </goals>\r
-                        <configuration>\r
-                            <inputSpec>${project.basedir}/api/rac-api.json</inputSpec>\r
-                            <language>openapi-yaml</language>\r
-                            <output>${project.basedir}/api/</output>\r
-                            <configOptions>\r
-                                <outputFile>rac-api.yaml</outputFile>\r
-                            </configOptions>\r
-                        </configuration>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-            <plugin>\r
-                <groupId>net.revelc.code.formatter</groupId>\r
-                <artifactId>formatter-maven-plugin</artifactId>\r
-                <version>${formatter-maven-plugin.version}</version>\r
-                <configuration>\r
-                    <configFile>${project.basedir}/eclipse-formatter.xml</configFile>\r
-                </configuration>\r
-                <!-- https://code.revelc.net/formatter-maven-plugin/ use mvn formatter:format\r
-                    spotless:apply process-sources -->\r
-            </plugin>\r
-            <plugin>\r
-                <groupId>com.diffplug.spotless</groupId>\r
-                <artifactId>spotless-maven-plugin</artifactId>\r
-                <version>${spotless-maven-plugin.version}</version>\r
-                <configuration>\r
-                    <java>\r
-                        <removeUnusedImports />\r
-                        <importOrder>\r
-                            <order>com,java,javax,org</order>\r
-                        </importOrder>\r
-                    </java>\r
-                </configuration>\r
-                <!-- https://github.com/diffplug/spotless/tree/master/plugin-maven use\r
-                    mvn spotless:apply to rewrite source files use mvn spotless:check to validate\r
-                    source files -->\r
-            </plugin>\r
-            <plugin>\r
-                <groupId>org.jacoco</groupId>\r
-                <artifactId>jacoco-maven-plugin</artifactId>\r
-                <version>${jacoco-maven-plugin.version}</version>\r
-                <executions>\r
-                    <execution>\r
-                        <id>default-prepare-agent</id>\r
-                        <goals>\r
-                            <goal>prepare-agent</goal>\r
-                        </goals>\r
-                    </execution>\r
-                    <execution>\r
-                        <id>default-report</id>\r
-                        <phase>prepare-package</phase>\r
-                        <goals>\r
-                            <goal>report</goal>\r
-                        </goals>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-            <plugin>\r
-                <groupId>io.fabric8</groupId>\r
-                <artifactId>docker-maven-plugin</artifactId>\r
-                <version>${docker-maven-plugin.version}</version>\r
-                <inherited>false</inherited>\r
-                <executions>\r
-                    <execution>\r
-                        <id>generate-r-app-catalogue-image</id>\r
-                        <phase>package</phase>\r
-                        <goals>\r
-                            <goal>build</goal>\r
-                        </goals>\r
-                        <configuration>\r
-                            <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>\r
-                            <images>\r
-                                <image>\r
-                                    <name>o-ran-sc/nonrtric-r-app-catalogue:${project.version}</name>\r
-                                    <build>\r
-                                        <cleanup>try</cleanup>\r
-                                        <contextDir>${basedir}</contextDir>\r
-                                        <dockerFile>Dockerfile</dockerFile>\r
-                                        <args>\r
-                                            <JAR>${project.build.finalName}.jar</JAR>\r
-                                        </args>\r
-                                        <tags>\r
-                                            <tag>${project.version}</tag>\r
-                                        </tags>\r
-                                    </build>\r
-                                </image>\r
-                            </images>\r
-                        </configuration>\r
-                    </execution>\r
-                    <execution>\r
-                        <id>push-r-app-catalogue-image</id>\r
-                        <goals>\r
-                            <goal>build</goal>\r
-                            <goal>push</goal>\r
-                        </goals>\r
-                        <configuration>\r
-                            <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>\r
-                            <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>\r
-                            <images>\r
-                                <image>\r
-                                    <name>o-ran-sc/nonrtric-r-app-catalogue:${project.version}</name>\r
-                                    <build>\r
-                                        <contextDir>${basedir}</contextDir>\r
-                                        <dockerFile>Dockerfile</dockerFile>\r
-                                        <args>\r
-                                            <JAR>${project.build.finalName}.jar</JAR>\r
-                                        </args>\r
-                                        <tags>\r
-                                            <tag>${project.version}</tag>\r
-                                            <tag>latest</tag>\r
-                                        </tags>\r
-                                    </build>\r
-                                </image>\r
-                            </images>\r
-                        </configuration>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-</project>\r
diff --git a/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/api/GeneralRappCatalogueControllerAdvisor.java b/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/api/GeneralRappCatalogueControllerAdvisor.java
deleted file mode 100644 (file)
index 072a5a0..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * Copyright (C) 2020 Nordix Foundation. All rights reserved.
- * ======================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oransc.rappcatalogue.api;
-
-import static org.springframework.http.HttpStatus.BAD_REQUEST;
-import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
-import static org.springframework.http.HttpStatus.NOT_FOUND;
-
-import org.oransc.rappcatalogue.exception.HeaderException;
-import org.oransc.rappcatalogue.exception.InvalidServiceException;
-import org.oransc.rappcatalogue.exception.ServiceNotFoundException;
-import org.oransc.rappcatalogue.model.ErrorInformation;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.ControllerAdvice;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
-
-@ControllerAdvice
-public class GeneralRappCatalogueControllerAdvisor extends ResponseEntityExceptionHandler {
-    @ExceptionHandler(InvalidServiceException.class)
-    public ResponseEntity<Object> handleInvalidServiceException(InvalidServiceException ex) {
-
-        return new ResponseEntity<>(getErrorInformation(ex, BAD_REQUEST), BAD_REQUEST);
-    }
-
-    @ExceptionHandler(ServiceNotFoundException.class)
-    public ResponseEntity<Object> handleServiceNotFoundException(ServiceNotFoundException ex) {
-
-        return new ResponseEntity<>(getErrorInformation(ex, NOT_FOUND), NOT_FOUND);
-    }
-
-    @ExceptionHandler(HeaderException.class)
-    public ResponseEntity<Object> handleHeaderException(HeaderException ex) {
-
-        return new ResponseEntity<>(getErrorInformation(ex, INTERNAL_SERVER_ERROR), INTERNAL_SERVER_ERROR);
-    }
-
-    private ErrorInformation getErrorInformation(Exception cause, HttpStatus status) {
-        ErrorInformation errorInfo = new ErrorInformation();
-        errorInfo.setDetail(cause.getMessage());
-        errorInfo.setStatus(status.value());
-        return errorInfo;
-    }
-}
diff --git a/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/api/ServicesApiDelegateImpl.java b/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/api/ServicesApiDelegateImpl.java
deleted file mode 100644 (file)
index 4615d69..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * Copyright (C) 2020 Nordix Foundation. All rights reserved.
- * ======================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oransc.rappcatalogue.api;
-
-import java.io.IOException;
-import java.sql.Date;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.oransc.rappcatalogue.exception.HeaderException;
-import org.oransc.rappcatalogue.exception.InvalidServiceException;
-import org.oransc.rappcatalogue.exception.ServiceNotFoundException;
-import org.oransc.rappcatalogue.model.InputService;
-import org.oransc.rappcatalogue.model.Service;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.context.request.NativeWebRequest;
-
-@org.springframework.stereotype.Service
-public class ServicesApiDelegateImpl implements ServicesApiDelegate {
-
-    private static final String LOCATION_HEADER = "Location";
-
-    @Autowired
-    private NativeWebRequest nativeWebRequest;
-
-    private ConcurrentHashMap<String, Service> registeredServices = new ConcurrentHashMap<>();
-
-    ServicesApiDelegateImpl(NativeWebRequest nativeWebRequest) {
-        this.nativeWebRequest = nativeWebRequest;
-    }
-
-    @Override
-    public Optional<NativeWebRequest> getRequest() {
-        return Optional.of(nativeWebRequest);
-    }
-
-    @Override
-    public ResponseEntity<Service> getIndividualService(String serviceName) throws ServiceNotFoundException {
-        Service service = registeredServices.get(serviceName);
-        if (service != null) {
-            return ResponseEntity.ok(service);
-        } else {
-            throw new ServiceNotFoundException(serviceName);
-        }
-    }
-
-    @Override
-    public ResponseEntity<List<Service>> getServices() {
-        return ResponseEntity.ok(new ArrayList<>(registeredServices.values()));
-    }
-
-    @Override
-    public ResponseEntity<Void> putIndividualService(String serviceName, InputService inputService)
-        throws InvalidServiceException, HeaderException {
-        if (isServiceValid(inputService)) {
-            if (registeredServices.put(serviceName, createService(serviceName, inputService)) == null) {
-                try {
-                    Optional<NativeWebRequest> request = getRequest();
-                    if (request.isPresent()) {
-                        addLocationHeaderToResponse(serviceName, request.get());
-                    }
-                } catch (HeaderException e) {
-                    registeredServices.remove(serviceName);
-                    throw e;
-                }
-                return new ResponseEntity<>(HttpStatus.CREATED);
-            } else {
-                return new ResponseEntity<>(HttpStatus.OK);
-            }
-        } else {
-            throw new InvalidServiceException();
-        }
-    }
-
-    private void addLocationHeaderToResponse(String serviceName, NativeWebRequest request) throws HeaderException {
-        try {
-            HttpServletRequest nativeRequest = request.getNativeRequest(HttpServletRequest.class);
-            HttpServletResponse nativeResponse = request.getNativeResponse(HttpServletResponse.class);
-            if (nativeRequest != null && nativeResponse != null) {
-                StringBuffer requestURL = nativeRequest.getRequestURL();
-                nativeResponse.addHeader(LOCATION_HEADER, requestURL.toString());
-                nativeResponse.getWriter().print("");
-            } else {
-                throw new HeaderException(LOCATION_HEADER, serviceName,
-                    new Exception("Native Request or Response missing"));
-            }
-        } catch (IOException e) {
-            throw new HeaderException(LOCATION_HEADER, serviceName, e);
-        }
-    }
-
-    @Override
-    public ResponseEntity<Void> deleteIndividualService(String serviceName) {
-        registeredServices.remove(serviceName);
-        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
-    }
-
-    /*
-     * java:S2589: Boolean expressions should not be gratuitous. Even though the
-     * version property is marked as @NotNull, it might be null coming from the
-     * client, hence the null check is needed.
-     */
-    @SuppressWarnings("java:S2589")
-    private boolean isServiceValid(InputService service) {
-        String version = service.getVersion();
-        return version != null && !version.isBlank();
-    }
-
-    private Service createService(String serviceName, InputService inputService) {
-        Service service = new Service();
-        service.setName(serviceName);
-        service.setDescription(inputService.getDescription());
-        service.setDisplayName(inputService.getDisplayName());
-        service.setVersion(inputService.getVersion());
-        service.setRegistrationDate(getTodaysDate());
-        return service;
-    }
-
-    private String getTodaysDate() {
-        long millis = System.currentTimeMillis();
-        Date date = new Date(millis);
-        return date.toString();
-    }
-}
diff --git a/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/configuration/TomcatConfig.java b/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/configuration/TomcatConfig.java
deleted file mode 100644 (file)
index a04a332..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * Copyright (C) 2021 Nordix Foundation. All rights reserved.
- * ======================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oransc.rappcatalogue.configuration;
-
-import org.apache.catalina.connector.Connector;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
-import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * Configure embedded Tomcat
- */
-
-@Configuration
-public class TomcatConfig {
-
-    @Value("${server.http-port}")
-    private int httpPort = 0;
-
-    // Embedded Tomcat with HTTP and HTTPS support
-    @Bean
-    public ServletWebServerFactory servletContainer() {
-        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
-
-        if (httpPort > 0) {
-            tomcat.addAdditionalTomcatConnectors(getHttpConnector(httpPort));
-        }
-        return tomcat;
-    }
-
-    private static Connector getHttpConnector(int httpPort) {
-        Connector connector = new Connector(TomcatServletWebServerFactory.DEFAULT_PROTOCOL);
-        connector.setScheme("http");
-        connector.setPort(httpPort);
-        connector.setSecure(false);
-        return connector;
-    }
-}
diff --git a/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/exception/HeaderException.java b/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/exception/HeaderException.java
deleted file mode 100644 (file)
index 8f64449..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * Copyright (C) 2020 Nordix Foundation. All rights reserved.
- * ======================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oransc.rappcatalogue.exception;
-
-public class HeaderException extends Exception {
-
-    private static final long serialVersionUID = -7798178963078284655L;
-
-    public HeaderException(String header, String serviceName, Exception cause) {
-        super(String.format("Unable to set header %s in put response for service %s. Cause: %s", header, serviceName,
-            cause.getMessage()));
-    }
-
-}
diff --git a/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/exception/InvalidServiceException.java b/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/exception/InvalidServiceException.java
deleted file mode 100644 (file)
index 45ec769..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * Copyright (C) 2020 Nordix Foundation. All rights reserved.
- * ======================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oransc.rappcatalogue.exception;
-
-public class InvalidServiceException extends Exception {
-    private static final long serialVersionUID = 3849219105170316564L;
-
-    public InvalidServiceException() {
-        super("Service is missing required property: version");
-    }
-}
diff --git a/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/exception/ServiceNotFoundException.java b/r-app-catalogue/src/main/java/org/oransc/rappcatalogue/exception/ServiceNotFoundException.java
deleted file mode 100644 (file)
index 8411cf4..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * Copyright (C) 2020 Nordix Foundation. All rights reserved.
- * ======================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oransc.rappcatalogue.exception;
-
-public class ServiceNotFoundException extends Exception {
-    private static final long serialVersionUID = 6579271315716003988L;
-
-    public ServiceNotFoundException(String serviceName) {
-        super(String.format("Service %s not found", serviceName));
-    }
-}
diff --git a/r-app-catalogue/src/test/java/org/oransc/rappcatalogue/HttpsRequestTest.java b/r-app-catalogue/src/test/java/org/oransc/rappcatalogue/HttpsRequestTest.java
deleted file mode 100644 (file)
index 8a66e14..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * Copyright (C) 2021 Nordix Foundation. All rights reserved.
- * ======================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oransc.rappcatalogue;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import javax.net.ssl.SSLContext;
-
-import org.apache.http.client.HttpClient;
-import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.ssl.SSLContextBuilder;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
-import org.springframework.boot.test.web.client.TestRestTemplate;
-import org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption;
-import org.springframework.boot.web.client.RestTemplateBuilder;
-import org.springframework.boot.web.server.AbstractConfigurableWebServerFactory;
-import org.springframework.boot.web.server.LocalServerPort;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit.jupiter.SpringExtension;
-import org.springframework.util.ResourceUtils;
-import org.springframework.web.client.ResourceAccessException;
-
-@ExtendWith(SpringExtension.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-@TestPropertySource(
-    properties = { //
-        "server.ssl.key-store=./config/r-app-catalogue-keystore.jks", //
-        "server.http-port=0"})
-public class HttpsRequestTest {
-
-    @Value("${server.ssl.key-store-password}")
-    private String keyStorePassword; // inject password from config
-
-    @Value("${server.ssl.key-store}")
-    private String keyStore; // inject keyStore from config
-
-    @LocalServerPort
-    private int port;
-
-    @Autowired
-    private AbstractConfigurableWebServerFactory webServerFactory;
-
-    @Test
-    public void testSsl() {
-        assertEquals(true, this.webServerFactory.getSsl().isEnabled());
-    }
-
-    @Test
-    public void rest_OverPlainHttp_GetsBadRequestRequiresTLS() throws Exception {
-        TestRestTemplate template = new TestRestTemplate();
-        ResponseEntity<String> responseEntity =
-            template.getForEntity("http://localhost:" + port + "/services", String.class);
-        assertEquals(HttpStatus.BAD_REQUEST, responseEntity.getStatusCode());
-        assertTrue(responseEntity.getBody().contains("This combination of host and port requires TLS"));
-    }
-
-    @Test
-    public void rest_WithoutSSLConfiguration_ThrowsSSLExceptionUnableFindValidCertPath() throws Exception {
-        TestRestTemplate template = new TestRestTemplate();
-
-        ResourceAccessException thrown = assertThrows(ResourceAccessException.class, () -> {
-            template.getForEntity("https://localhost:" + port + "/services", String.class);
-        });
-        assertTrue(thrown.getMessage().contains("unable to find valid certification path to requested target"));
-    }
-
-    @Test
-    public void rest_WithTwoWaySSL_AuthenticatesAndGetsExpectedResponse() throws Exception {
-
-        SSLContext sslContext = new SSLContextBuilder().loadKeyMaterial(ResourceUtils.getFile(keyStore),
-            keyStorePassword.toCharArray(), keyStorePassword.toCharArray()).build();
-
-        SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(sslContext);
-        HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build();
-        HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
-        RestTemplateBuilder rtb =
-            new RestTemplateBuilder().requestFactory(() -> factory).rootUri("https://localhost:" + port);
-
-        TestRestTemplate template = new TestRestTemplate(rtb, null, null, HttpClientOption.SSL);
-
-        ResponseEntity<String> responseEntity = template.getForEntity("/services", String.class);
-        assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
-        assertEquals("[]", responseEntity.getBody());
-    }
-
-}
diff --git a/r-app-catalogue/src/test/java/org/oransc/rappcatalogue/api/GeneralRappCatalogueControllerAdvisorTest.java b/r-app-catalogue/src/test/java/org/oransc/rappcatalogue/api/GeneralRappCatalogueControllerAdvisorTest.java
deleted file mode 100644 (file)
index 24afa09..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * Copyright (C) 2020 Nordix Foundation. All rights reserved.
- * ======================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oransc.rappcatalogue.api;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.springframework.http.HttpStatus.BAD_REQUEST;
-import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
-import static org.springframework.http.HttpStatus.NOT_FOUND;
-
-import org.junit.jupiter.api.Test;
-import org.oransc.rappcatalogue.exception.HeaderException;
-import org.oransc.rappcatalogue.exception.InvalidServiceException;
-import org.oransc.rappcatalogue.exception.ServiceNotFoundException;
-import org.oransc.rappcatalogue.model.ErrorInformation;
-import org.springframework.http.ResponseEntity;
-
-class GeneralRappCatalogueControllerAdvisorTest {
-
-    @Test
-    void handleInvalidServiceException_shouldReturnBadRequestWithMessage() {
-        GeneralRappCatalogueControllerAdvisor advisorUnderTest = new GeneralRappCatalogueControllerAdvisor();
-
-        InvalidServiceException exception = new InvalidServiceException();
-
-        ResponseEntity<Object> response = advisorUnderTest.handleInvalidServiceException(exception);
-
-        assertThat(response.getStatusCode()).isEqualTo(BAD_REQUEST);
-        ErrorInformation body = (ErrorInformation) response.getBody();
-        assertThat(body.getStatus()).isEqualTo(BAD_REQUEST.value());
-        assertThat(body.getDetail()).isEqualTo("Service is missing required property: version");
-    }
-
-    @Test
-    void handleServiceNotFoundException_shouldReturnNotFoundWithMessage() {
-        GeneralRappCatalogueControllerAdvisor advisorUnderTest = new GeneralRappCatalogueControllerAdvisor();
-
-        ServiceNotFoundException exception = new ServiceNotFoundException("Name");
-
-        ResponseEntity<Object> response = advisorUnderTest.handleServiceNotFoundException(exception);
-
-        assertThat(response.getStatusCode()).isEqualTo(NOT_FOUND);
-        ErrorInformation body = (ErrorInformation) response.getBody();
-        assertThat(body.getStatus()).isEqualTo(NOT_FOUND.value());
-        assertThat(body.getDetail()).isEqualTo("Service Name not found");
-    }
-
-    @Test
-    void handleHeaderException_shouldReturnInternalServerErrorWithMessage() {
-        GeneralRappCatalogueControllerAdvisor advisorUnderTest = new GeneralRappCatalogueControllerAdvisor();
-
-        String serviceName = "Service";
-        HeaderException exception = new HeaderException("Header", serviceName, new Exception("Cause"));
-
-        ResponseEntity<Object> response = advisorUnderTest.handleHeaderException(exception);
-
-        assertThat(response.getStatusCode()).isEqualTo(INTERNAL_SERVER_ERROR);
-        ErrorInformation body = (ErrorInformation) response.getBody();
-        assertThat(body.getStatus()).isEqualTo(INTERNAL_SERVER_ERROR.value());
-        assertThat(body.getDetail())
-            .isEqualTo("Unable to set header Header in put response for service " + serviceName + ". Cause: Cause");
-    }
-}
diff --git a/r-app-catalogue/src/test/java/org/oransc/rappcatalogue/api/ServicesApiDelegateImplTest.java b/r-app-catalogue/src/test/java/org/oransc/rappcatalogue/api/ServicesApiDelegateImplTest.java
deleted file mode 100644 (file)
index dd10a65..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-
-package org.oransc.rappcatalogue.api;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import static org.springframework.http.HttpStatus.CREATED;
-import static org.springframework.http.HttpStatus.NO_CONTENT;
-import static org.springframework.http.HttpStatus.OK;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.sql.Date;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-import org.oransc.rappcatalogue.exception.HeaderException;
-import org.oransc.rappcatalogue.exception.InvalidServiceException;
-import org.oransc.rappcatalogue.exception.ServiceNotFoundException;
-import org.oransc.rappcatalogue.model.InputService;
-import org.oransc.rappcatalogue.model.Service;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.context.request.NativeWebRequest;
-
-@ExtendWith(MockitoExtension.class)
-class ServicesApiDelegateImplTest {
-
-    @Mock
-    NativeWebRequest webRequestMock;
-
-    private static final String INVALID_SERVICE_MESSAGE = "Service is missing required property: version";
-    private static final String SERVICE_NAME = "Service Name";
-    private static final String SERVICE_DESCRIPTION = "description";
-    private static final String SERVICE_VERSION = "1.0";
-    private static final String SERVICE_DISPLAY_NAME = "Display Name";
-
-    @Test
-    void getAddedService_shouldReturnService() throws Exception {
-        ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl(webRequestMock);
-
-        InputService service = new InputService();
-        service.setDescription(SERVICE_DESCRIPTION);
-        service.setVersion(SERVICE_VERSION);
-        service.setDisplayName(SERVICE_DISPLAY_NAME);
-
-        whenPrintResponseShouldWork();
-
-        delegateUnderTest.putIndividualService(SERVICE_NAME, service);
-
-        ResponseEntity<Service> response = delegateUnderTest.getIndividualService(SERVICE_NAME);
-
-        assertThat(response.getStatusCode()).isEqualTo(OK);
-        assertThat(response.getBody().getName()).isEqualTo(SERVICE_NAME);
-    }
-
-    @Test
-    void getMissingService_shouldThrowException() {
-        ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl(null);
-
-        Exception exception = assertThrows(ServiceNotFoundException.class, () -> {
-            delegateUnderTest.getIndividualService(SERVICE_NAME);
-        });
-
-        String expectedMessage = "Service " + SERVICE_NAME + " not found";
-        String actualMessage = exception.getMessage();
-
-        assertThat(actualMessage).isEqualTo(expectedMessage);
-    }
-
-    @Test
-    void putNewValidService_shouldBeCreatedAndRegisteredAndUrlToNewServiceAddedToLocationHeaderInResponse()
-        throws Exception {
-        ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl(webRequestMock);
-
-        InputService service = new InputService();
-        service.setDescription(SERVICE_DESCRIPTION);
-        service.setVersion(SERVICE_VERSION);
-        service.setDisplayName(SERVICE_DISPLAY_NAME);
-
-        String urlToCreatedService = "URL to created Service";
-        HttpServletResponse servletResponseMock = whenPrintResponseShouldWork(urlToCreatedService);
-
-        ResponseEntity<Void> putResponse = delegateUnderTest.putIndividualService(SERVICE_NAME, service);
-
-        assertThat(putResponse.getStatusCode()).isEqualTo(CREATED);
-        verify(servletResponseMock).addHeader("Location", urlToCreatedService);
-
-        ResponseEntity<Service> getResponse = delegateUnderTest.getIndividualService(SERVICE_NAME);
-
-        assertThat(getResponse.getStatusCode()).isEqualTo(OK);
-        Service body = getResponse.getBody();
-        assertThat(body.getName()).isEqualTo(SERVICE_NAME);
-        assertThat(body.getRegistrationDate()).isEqualTo(getTodaysDate());
-    }
-
-    @Test
-    void putModifiedService_shouldBeModified() throws Exception {
-        ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl(webRequestMock);
-
-        InputService service = new InputService();
-        service.setDescription(SERVICE_DESCRIPTION);
-        service.setVersion(SERVICE_VERSION);
-        service.setDisplayName(SERVICE_DISPLAY_NAME);
-
-        whenPrintResponseShouldWork();
-
-        delegateUnderTest.putIndividualService(SERVICE_NAME, service);
-
-        String newDescription = "New description";
-        service.setDescription(newDescription);
-        ResponseEntity<Void> putResponse = delegateUnderTest.putIndividualService(SERVICE_NAME, service);
-
-        assertThat(putResponse.getStatusCode()).isEqualTo(OK);
-
-        ResponseEntity<Service> getResponse = delegateUnderTest.getIndividualService(SERVICE_NAME);
-
-        assertThat(getResponse.getStatusCode()).isEqualTo(OK);
-        assertThat(getResponse.getBody().getDescription()).isEqualTo(newDescription);
-    }
-
-    @Test
-    void putServiceWithVersionNull_shouldThrowException() {
-        ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl(null);
-
-        InputService service = new InputService();
-        service.setDescription(SERVICE_DESCRIPTION);
-        service.setDisplayName(SERVICE_DISPLAY_NAME);
-
-        Exception exception = assertThrows(InvalidServiceException.class, () -> {
-            delegateUnderTest.putIndividualService(SERVICE_NAME, service);
-        });
-
-        assertThat(exception.getMessage()).isEqualTo(INVALID_SERVICE_MESSAGE);
-    }
-
-    @Test
-    void putServiceWithBlankVersion_shouldThrowException() {
-        ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl(null);
-
-        InputService service = new InputService();
-        service.setVersion("");
-        service.setDescription(SERVICE_DESCRIPTION);
-        service.setDisplayName(SERVICE_DISPLAY_NAME);
-
-        Exception exception = assertThrows(InvalidServiceException.class, () -> {
-            delegateUnderTest.putIndividualService(SERVICE_NAME, service);
-        });
-
-        assertThat(exception.getMessage()).isEqualTo(INVALID_SERVICE_MESSAGE);
-    }
-
-    @Test
-    void putServiceWhenIoExceptionAddingHeader_shouldThrowExceptionAndNoServiceCreated() throws Exception {
-        ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl(webRequestMock);
-
-        whenGetRequestUrlThenReturnUrl();
-        HttpServletResponse servletResponseMock = mock(HttpServletResponse.class);
-        when(webRequestMock.getNativeResponse(HttpServletResponse.class)).thenReturn(servletResponseMock);
-        when(servletResponseMock.getWriter()).thenThrow(new IOException("Error"));
-
-        InputService service = new InputService();
-        service.setVersion("1.0");
-        service.setDescription(SERVICE_DESCRIPTION);
-        service.setDisplayName(SERVICE_DISPLAY_NAME);
-
-        Exception exception = assertThrows(HeaderException.class, () -> {
-            delegateUnderTest.putIndividualService(SERVICE_NAME, service);
-        });
-
-        assertThat(exception.getMessage())
-            .isEqualTo("Unable to set header Location in put response for service " + SERVICE_NAME + ". Cause: Error");
-
-        ResponseEntity<List<Service>> response = delegateUnderTest.getServices();
-        assertThat(response.getBody()).isEmpty();
-    }
-
-    @Test
-    void getServices_shouldProvideArrayOfAddedServiceNames() throws Exception {
-        ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl(webRequestMock);
-
-        InputService service1 = new InputService();
-        service1.setDescription("description 1");
-        service1.setVersion(SERVICE_VERSION);
-        service1.setDisplayName("Display Name 1");
-
-        InputService service2 = new InputService();
-        service2.setDescription("description 2");
-        service2.setVersion(SERVICE_VERSION);
-        service2.setDisplayName("Display Name 2");
-
-        whenPrintResponseShouldWork();
-
-        String serviceName1 = "Service Name 1";
-        delegateUnderTest.putIndividualService(serviceName1, service1);
-        String serviceName2 = "Service Name 2";
-        delegateUnderTest.putIndividualService(serviceName2, service2);
-
-        ResponseEntity<List<Service>> response = delegateUnderTest.getServices();
-
-        assertThat(response.getStatusCode()).isEqualTo(OK);
-        List<Service> services = response.getBody();
-        assertThat(services).hasSize(2);
-        List<String> expectedServiceNames = Arrays.asList(serviceName1, serviceName2);
-        assertThat(expectedServiceNames).contains(services.get(0).getName()) //
-            .contains(services.get(1).getName());
-    }
-
-    @Test
-    void deleteService_shouldBeOk() throws Exception {
-        ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl(webRequestMock);
-
-        InputService service = new InputService();
-        service.setDescription(SERVICE_DESCRIPTION);
-        service.setVersion(SERVICE_VERSION);
-        service.setDisplayName(SERVICE_DISPLAY_NAME);
-
-        whenPrintResponseShouldWork();
-
-        delegateUnderTest.putIndividualService(SERVICE_NAME, service);
-
-        ResponseEntity<List<Service>> servicesResponse = delegateUnderTest.getServices();
-
-        assertThat(servicesResponse.getBody()).hasSize(1);
-
-        ResponseEntity<Void> deleteResponse = delegateUnderTest.deleteIndividualService(SERVICE_NAME);
-
-        assertThat(deleteResponse.getStatusCode()).isEqualTo(NO_CONTENT);
-
-        servicesResponse = delegateUnderTest.getServices();
-
-        assertThat(servicesResponse.getBody()).isEmpty();
-    }
-
-    private void whenGetRequestUrlThenReturnUrl() {
-        whenGetRequestUrlThenReturnUrl("URL");
-    }
-
-    private void whenGetRequestUrlThenReturnUrl(String url) {
-        HttpServletRequest servletRequestMock = mock(HttpServletRequest.class);
-        when(webRequestMock.getNativeRequest(HttpServletRequest.class)).thenReturn(servletRequestMock);
-        when(servletRequestMock.getRequestURL()).thenReturn(new StringBuffer(url));
-    }
-
-    private HttpServletResponse whenPrintResponseShouldWork() {
-        return whenPrintResponseShouldWork("URL");
-    }
-
-    private HttpServletResponse whenPrintResponseShouldWork(String url) {
-        whenGetRequestUrlThenReturnUrl(url);
-        HttpServletResponse servletResponseMock = mock(HttpServletResponse.class);
-        when(webRequestMock.getNativeResponse(HttpServletResponse.class)).thenReturn(servletResponseMock);
-        PrintWriter printWriterMock = mock(PrintWriter.class);
-        try {
-            when(servletResponseMock.getWriter()).thenReturn(printWriterMock);
-        } catch (IOException e) {
-            // Nothing
-        }
-        return servletResponseMock;
-    }
-
-    private String getTodaysDate() {
-        long millis = System.currentTimeMillis();
-        Date date = new Date(millis);
-        return date.toString();
-    }
-}