diff options
Diffstat (limited to 'participant/participant-impl/participant-impl-kserve')
3 files changed, 4 insertions, 50 deletions
diff --git a/participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/config/ParticipantConfig.java b/participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/config/ParticipantConfig.java deleted file mode 100755 index 1a671343a..000000000 --- a/participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/config/ParticipantConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2023 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========================================================= - */ - -package org.onap.policy.clamp.acm.participant.kserve.config; - -import org.onap.policy.clamp.acm.participant.intermediary.api.ParticipantIntermediaryApi; -import org.onap.policy.clamp.acm.participant.kserve.handler.AutomationCompositionElementHandler; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class ParticipantConfig { - - /** - * Register AutomationCompositionElementListener. - * - * @param intermediaryApi the ParticipantIntermediaryApi - * @param acElementHandler the AutomationComposition Element Handler - */ - @Autowired - public void registerAutomationCompositionElementListener(ParticipantIntermediaryApi intermediaryApi, - AutomationCompositionElementHandler acElementHandler) { - intermediaryApi.registerAutomationCompositionElementListener(acElementHandler); - acElementHandler.setIntermediaryApi(intermediaryApi); - } -} diff --git a/participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/handler/AutomationCompositionElementHandler.java b/participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/handler/AutomationCompositionElementHandler.java index 4d556579d..ed02314cd 100755 --- a/participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/handler/AutomationCompositionElementHandler.java +++ b/participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/handler/AutomationCompositionElementHandler.java @@ -36,7 +36,6 @@ import javax.validation.ValidationException; import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; -import lombok.Setter; import org.apache.http.HttpStatus; import org.onap.policy.clamp.acm.participant.intermediary.api.AutomationCompositionElementListener; import org.onap.policy.clamp.acm.participant.intermediary.api.ParticipantIntermediaryApi; @@ -72,8 +71,7 @@ public class AutomationCompositionElementHandler implements AutomationCompositio private ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); - @Setter - private ParticipantIntermediaryApi intermediaryApi; + private final ParticipantIntermediaryApi intermediaryApi; private final KserveClient kserveClient; diff --git a/participant/participant-impl/participant-impl-kserve/src/test/java/org/onap/policy/clamp/acm/participant/kserve/handler/AcElementHandlerTest.java b/participant/participant-impl/participant-impl-kserve/src/test/java/org/onap/policy/clamp/acm/participant/kserve/handler/AcElementHandlerTest.java index 38db1b8c1..6112488bf 100755 --- a/participant/participant-impl/participant-impl-kserve/src/test/java/org/onap/policy/clamp/acm/participant/kserve/handler/AcElementHandlerTest.java +++ b/participant/participant-impl/participant-impl-kserve/src/test/java/org/onap/policy/clamp/acm/participant/kserve/handler/AcElementHandlerTest.java @@ -58,13 +58,12 @@ class AcElementHandlerTest { private final KserveClient kserveClient = mock(KserveClient.class); + private ParticipantIntermediaryApi participantIntermediaryApi = mock(ParticipantIntermediaryApi.class); + @InjectMocks @Spy private AutomationCompositionElementHandler automationCompositionElementHandler = - new AutomationCompositionElementHandler(kserveClient); - - @Mock - private ParticipantIntermediaryApi participantIntermediaryApi; + new AutomationCompositionElementHandler(participantIntermediaryApi, kserveClient); @Mock private ExecutorService executor; |