1 package org.onap.cps.ncmp.rest.controller.handlers
3 import spock.lang.Specification
5 class NcmpDatastoreResourceRequestHandlerFactorySpec extends Specification {
7 def objectUnderTest = new NcmpDatastoreResourceRequestHandlerFactory(null, null)
9 def 'Creating ncmp datastore request handlers.'() {
10 when: 'a ncmp datastore request handler is created for #datastoreType'
11 def result = objectUnderTest.getNcmpDatastoreResourceRequestHandler(datastoreType)
12 then: 'the result is of the expected class'
13 result.class == expectedClass
14 where: 'the following type of datastore is used'
15 datastoreType || expectedClass
16 DatastoreType.OPERATIONAL || NcmpDatastoreOperationalResourceRequestHandler
17 DatastoreType.PASSTHROUGH_OPERATIONAL || NcmpDatastorePassthroughOperationalResourceRequestHandler
18 DatastoreType.PASSTHROUGH_RUNNING || NcmpDatastorePassthroughRunningResourceRequestHandler