From 0d562688867a1b2e7a34ee6416cd54f7a9f6b89e Mon Sep 17 00:00:00 2001 From: "Chan, Mercy" Date: Mon, 1 Jul 2019 08:07:17 -0400 Subject: support new query param format - added format query parameter (optional), implemented logic to populate requestStatus field based on whether or not format is present moved request status constants to its own class visible globally. - changed @requestParam to @QueryParam in GET endpoint (OrchestrationRequests class. updated unit tests to call method being tested directly rather than from another private function - moved setting requestStatus to a separate method, also updated unit tests to separate out each scenarion into its own method - added unit test for when format=detail, corrected existing unit tests to test result to be FAILED - updated Status.java to include extra request status values; moved Status class to common org.onap.so.constants package Change-Id: Ic593de5fdfdcbc3121f481c86d1e261406082260 Issue-ID: SO-2080 Signed-off-by: Benjamin, Max (mb388a) --- .../apihandler/filters/ResponseUpdateFilter.java | 2 +- .../java/org/onap/so/apihandlerinfra/Status.java | 29 ---------------------- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Status.java (limited to 'mso-api-handlers/mso-api-handler-common/src/main') diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/filters/ResponseUpdateFilter.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/filters/ResponseUpdateFilter.java index eb52625bb6..119a0a560e 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/filters/ResponseUpdateFilter.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/filters/ResponseUpdateFilter.java @@ -31,7 +31,7 @@ import javax.ws.rs.core.Response; import javax.ws.rs.ext.Provider; import javax.ws.rs.ext.Providers; import org.onap.logging.ref.slf4j.ONAPLogConstants; -import org.onap.so.apihandlerinfra.Status; +import org.onap.so.constants.Status; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.client.RequestsDbClient; import org.onap.so.serviceinstancebeans.RequestError; diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Status.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Status.java deleted file mode 100644 index b791bf147b..0000000000 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Status.java +++ /dev/null @@ -1,29 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. 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.onap.so.apihandlerinfra; - - -/* - * Enum for Status values returned by API Handler to Tail-F - */ -public enum Status { - PENDING, IN_PROGRESS, COMPLETE, COMPLETED, FAILED, TIMEOUT, UNLOCKED, PENDING_MANUAL_TASK -} -- cgit 1.2.3-korg