diff options
author | Joss Armstrong <joss.armstrong@ericsson.com> | 2018-12-20 09:42:37 +0000 |
---|---|---|
committer | J Armstrong <joss.armstrong@ericsson.com> | 2018-12-20 09:50:00 +0000 |
commit | f87fdde3dc86f801f97c1d18bee03d0c973de014 (patch) | |
tree | bf295bebc959825e572c6c6faf254ffe125dcee0 /appc-oam/appc-oam-bundle/src/main/java | |
parent | 8b1be00c0642f1f167cd3d136aa8215e40deb142 (diff) |
Test coverage in OAM and OAM message-adapter
Increased coverage from 19% to 96% for
oam package.
Increased coverage from 14% to 93% for
oam.message-adapter package.
Issue-ID: APPC-1290
Change-Id: I91c313ba42b49718445463a524bf80ac0734b0a9
Signed-off-by: Joss Armstrong <joss.armstrong@ericsson.com>
Diffstat (limited to 'appc-oam/appc-oam-bundle/src/main/java')
-rw-r--r-- | appc-oam/appc-oam-bundle/src/main/java/org/onap/appc/oam/AppcOam.java | 42 | ||||
-rw-r--r-- | appc-oam/appc-oam-bundle/src/main/java/org/onap/appc/oam/messageadapter/OAMContext.java | 9 |
2 files changed, 42 insertions, 9 deletions
diff --git a/appc-oam/appc-oam-bundle/src/main/java/org/onap/appc/oam/AppcOam.java b/appc-oam/appc-oam-bundle/src/main/java/org/onap/appc/oam/AppcOam.java index c52f7168b..cbe2a4d57 100644 --- a/appc-oam/appc-oam-bundle/src/main/java/org/onap/appc/oam/AppcOam.java +++ b/appc-oam/appc-oam-bundle/src/main/java/org/onap/appc/oam/AppcOam.java @@ -5,6 +5,8 @@ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs + * ================================================================================ + * Modifications (C) 2018 Ericsson * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -259,7 +261,7 @@ public class AppcOam implements AutoCloseable, AppcOamService { final CommonHeader commonHeader = stopInput.getCommonHeader(); OamStopProcessor oamStopProcessor = - new OamStopProcessor(logger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); + getOamStopProcessor(logger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); Status status = oamStopProcessor.processRequest(stopInput); StopOutputBuilder stopOutputBuilder = new StopOutputBuilder(); @@ -277,7 +279,7 @@ public class AppcOam implements AutoCloseable, AppcOamService { final CommonHeader commonHeader = input.getCommonHeader(); OamRestartProcessor oamRestartProcessor = - new OamRestartProcessor(logger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); + getOamRestartProcessor(logger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); Status status = oamRestartProcessor.processRequest(input); RestartOutputBuilder restartOutputBuilder = new RestartOutputBuilder(); @@ -296,7 +298,7 @@ public class AppcOam implements AutoCloseable, AppcOamService { final CommonHeader commonHeader = maintenanceModeInput.getCommonHeader(); OamMmodeProcessor oamMmodeProcessor = - new OamMmodeProcessor(logger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); + getOamMmodeProcessor(logger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); Status status = oamMmodeProcessor.processRequest(maintenanceModeInput); MaintenanceModeOutputBuilder maintenanceModeOutputBuilder = new MaintenanceModeOutputBuilder(); @@ -326,7 +328,7 @@ public class AppcOam implements AutoCloseable, AppcOamService { final CommonHeader commonHeader = startInput.getCommonHeader(); OamStartProcessor oamStartProcessor = - new OamStartProcessor(logger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); + getOamStartProcessor(logger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); Status status = oamStartProcessor.processRequest(startInput); StartOutputBuilder startOutputBuilder = new StartOutputBuilder(); @@ -335,4 +337,36 @@ public class AppcOam implements AutoCloseable, AppcOamService { StartOutput startOutput = startOutputBuilder.build(); return RpcResultBuilder.success(startOutput).buildFuture(); } + + protected OamStartProcessor getOamStartProcessor(EELFLogger eelfLogger, + ConfigurationHelper configurationHelper, + StateHelper stateHelper, + AsyncTaskHelper asyncTaskHelper, + OperationHelper operationHelper) { + return new OamStartProcessor(eelfLogger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); + } + + protected OamStopProcessor getOamStopProcessor(EELFLogger eelfLogger, + ConfigurationHelper configurationHelper, + StateHelper stateHelper, + AsyncTaskHelper asyncTaskHelper, + OperationHelper operationHelper) { + return new OamStopProcessor(eelfLogger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); + } + + protected OamRestartProcessor getOamRestartProcessor(EELFLogger eelfLogger, + ConfigurationHelper configurationHelper, + StateHelper stateHelper, + AsyncTaskHelper asyncTaskHelper, + OperationHelper operationHelper) { + return new OamRestartProcessor(eelfLogger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); + } + + protected OamMmodeProcessor getOamMmodeProcessor(EELFLogger eelfLogger, + ConfigurationHelper configurationHelper, + StateHelper stateHelper, + AsyncTaskHelper asyncTaskHelper, + OperationHelper operationHelper) { + return new OamMmodeProcessor(eelfLogger, configurationHelper, stateHelper, asyncTaskHelper, operationHelper); + } } diff --git a/appc-oam/appc-oam-bundle/src/main/java/org/onap/appc/oam/messageadapter/OAMContext.java b/appc-oam/appc-oam-bundle/src/main/java/org/onap/appc/oam/messageadapter/OAMContext.java index 464fbe78c..ac009d6ad 100644 --- a/appc-oam/appc-oam-bundle/src/main/java/org/onap/appc/oam/messageadapter/OAMContext.java +++ b/appc-oam/appc-oam-bundle/src/main/java/org/onap/appc/oam/messageadapter/OAMContext.java @@ -5,6 +5,8 @@ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs + * ================================================================================ + * Modifications (C) 2018 Ericsson * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,12 +25,9 @@ package org.onap.appc.oam.messageadapter; - - - -import org.opendaylight.yang.gen.v1.org.onap.appc.oam.rev170303.*; import org.opendaylight.yang.gen.v1.org.onap.appc.oam.rev170303.common.header.CommonHeader; -import org.opendaylight.yang.gen.v1.org.onap.appc.oam.rev170303.status.Status;import org.onap.appc.oam.AppcOam; +import org.opendaylight.yang.gen.v1.org.onap.appc.oam.rev170303.status.Status; +import org.onap.appc.oam.AppcOam; public class OAMContext { |