From 937803bdd4b6e459093e42d784195a60556a7021 Mon Sep 17 00:00:00 2001 From: "m.kowalski3" Date: Wed, 29 May 2019 16:07:52 +0200 Subject: Add unit tests for ConfigurationManager Issue-ID: SDC-2327 Signed-off-by: Marcin Kowalski Change-Id: I2acfba224c46ffa743a254b1c560767b947f8fdd --- .../resources/config/common/configuration.yaml | 62 ++++++++++++++++++++++ .../config/common/ecomp-error-configuration.yaml | 25 +++++++++ .../config/common/error-configuration.yaml | 26 +++++++++ 3 files changed, 113 insertions(+) create mode 100644 common-app-api/src/test/resources/config/common/configuration.yaml create mode 100644 common-app-api/src/test/resources/config/common/ecomp-error-configuration.yaml create mode 100644 common-app-api/src/test/resources/config/common/error-configuration.yaml (limited to 'common-app-api/src/test/resources') diff --git a/common-app-api/src/test/resources/config/common/configuration.yaml b/common-app-api/src/test/resources/config/common/configuration.yaml new file mode 100644 index 0000000000..59d4121116 --- /dev/null +++ b/common-app-api/src/test/resources/config/common/configuration.yaml @@ -0,0 +1,62 @@ +identificationHeaderFields: + - HTTP_IV_USER + +# catalog backend hostname +beFqdn: localhost +# sdccatalog.com + +# catalog backend http port +beHttpPort: 8080 + +# catalog backend http context +beContext: /sdc/rest/config/get + +# catalog backend protocol +beProtocol: http + +# catalog backend ssl port +beSslPort: 8443 + +version: 1.1.0 +released: 2012-11-30 +toscaConformanceLevel: 8.0 +minToscaConformanceLevel: 3.0 + +titanCfgFile: /home/vagrant/catalog-be/config/catalog-be/titan.properties +titanInMemoryGraph: false +titanLockTimeout: 1800 + +# The interval to try and reconnect to titan DB when it is down during ASDC startup: +titanReconnectIntervalInSeconds: 3 + +# The read timeout towards Titan DB when health check is invoked: +titanHealthCheckReadTimeout: 1 + +# The interval to try and reconnect to Elasticsearch when it is down during ASDC startup: +esReconnectIntervalInSeconds: 3 +uebHealthCheckReconnectIntervalInSeconds: 15 +uebHealthCheckReadTimeout: 4 + +# Protocols +protocols: + - http + - https + +# Default imports +defaultImports: + - nodes: + file: nodes.yml + - datatypes: + file: data.yml + - capabilities: + file: capabilities.yml + - relationships: + file: relationships.yml + - groups: + file: groups.yml + - policies: + file: policies.yml + +# Users +users: + tom: passwd diff --git a/common-app-api/src/test/resources/config/common/ecomp-error-configuration.yaml b/common-app-api/src/test/resources/config/common/ecomp-error-configuration.yaml new file mode 100644 index 0000000000..64bd77e0bb --- /dev/null +++ b/common-app-api/src/test/resources/config/common/ecomp-error-configuration.yaml @@ -0,0 +1,25 @@ +errors: + + BeRestApiGeneralError: { + type: SYSTEM_ERROR, + code: ASDC_4000, + severity: ERROR, + description: "Unexpected error during BE REST API execution", + alarmSeverity: CRITICAL + } + + BeHealthCheckError: { + type: SYSTEM_ERROR, + code: ASDC_3010, + severity: ERROR, + description: "Error during BE Health Check", + alarmSeverity: CRITICAL + } + + BeInitializationError: { + type: SYSTEM_ERROR, + code: ASDC_4019, + severity: ERROR, + description: "Catalog-BE was not initialized properly", + alarmSeverity: CRITICAL + } \ No newline at end of file diff --git a/common-app-api/src/test/resources/config/common/error-configuration.yaml b/common-app-api/src/test/resources/config/common/error-configuration.yaml new file mode 100644 index 0000000000..9db9bbdc58 --- /dev/null +++ b/common-app-api/src/test/resources/config/common/error-configuration.yaml @@ -0,0 +1,26 @@ +# Errors +errors: + OK: { + code: 200, + message: "OK" + } + CREATED: { + code: 201, + message: "OK" + } + NO_CONTENT: { + code: 204, + message: "No Content" + } +#--------POL4050----------------------------- + NOT_ALLOWED: { + code: 405, + message: "Error: Method not allowed.", + messageId: "POL4050" + } +#--------POL5000----------------------------- + GENERAL_ERROR: { + code: 500, + message: "Error: Internal Server Error. Please try again later.", + messageId: "POL5000" + } -- cgit 1.2.3-korg