diff options
author | Pooja03 <PM00501616@techmahindra.com> | 2018-03-27 19:44:23 +0530 |
---|---|---|
committer | Pooja03 <PM00501616@techmahindra.com> | 2018-03-27 19:44:43 +0530 |
commit | 8297bd0760ff3c46ef36d5a6408a757cf36097fe (patch) | |
tree | 8436740e2c4039c4e5e93bcdf66792844a89ecbe /UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java | |
parent | a0cd2159e2dbfde7613ea7dda8db1eacced4ca69 (diff) |
Added UniversalVesAdapter TestCases in the Mapper
Adding UniversalVesAdapter TestCases in Mapper
Change-Id: I68023d84ada0104ecf46a74e129e104a398543ea
Issue-ID: DCAEGEN2-335
Signed-off-by: Pooja03 <PM00501616@techmahindra.com>
Diffstat (limited to 'UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java')
-rw-r--r-- | UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java index 14c5a83..1e6006a 100644 --- a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java +++ b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java @@ -17,16 +17,17 @@ * limitations under the License. * ============LICENSE_END========================================================= */ +package org.onap.universalvesadapter.service; -package org.onap.universalvesadapter.service; - +import org.onap.universalvesadapter.exception.MapperConfigException; +import org.onap.universalvesadapter.utils.MapperConfigUtils; //import org.onap.universalvesadapter.adapter.GenericAdapter; //import org.onap.universalvesadapter.adapter.UniversalEventAdapter; //import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * This service is written to identify the different type of events + * This service is written to identify the different type of events * * @author kmalbari * @@ -34,12 +35,11 @@ import org.springframework.stereotype.Component; @Component public class AdapterService { - /*@Autowired - private UniversalEventAdapter snmpTrapEventAdapter; - public GenericAdapter identifyIncomingJsonFormatAndReturnAdapter() { - return snmpTrapEventAdapter; - }*/ - + /* + * @Autowired private UniversalEventAdapter snmpTrapEventAdapter; public + * GenericAdapter identifyIncomingJsonFormatAndReturnAdapter() { return + * snmpTrapEventAdapter; } + */ /** * Identifies eventype by parsing the incoming json file. @@ -47,11 +47,13 @@ public class AdapterService { * @param incomingJsonString * * @return the event type + * @throws MapperConfigException + * if mapper config did not perform correctly */ - public String identifyEventTypeFromIncomingJson(String incomingJsonString) { - - //TODO A proper logic to identify diffeent events is needed here - return "snmp"; + public String identifyEventTypeFromIncomingJson(String incomingJsonString) throws MapperConfigException { + + // TODO A proper logic to identify diffeent events is needed here + return MapperConfigUtils.checkIncomingJsonForMatchingDomain(incomingJsonString); } } |