diff options
author | 2019-11-20 17:04:52 -0500 | |
---|---|---|
committer | 2019-11-21 14:12:15 +0000 | |
commit | 5c186597021771a83f1a0faae5b9955123171c84 (patch) | |
tree | 1d0fba66c2dc8c7a5aafc40a40b0bb676841ec87 /ms/blueprintsprocessor/modules/inbounds/designer-api/src/test | |
parent | e9729737599fd227fd852bd63a7ea5678cd1d8ce (diff) |
Bootstrap Rest and GRPC API
CDS loads model types, dictionaries and CBA multiple times based on cluster size.
This commits avoid auto loading, and provides an API to bootstrap, if necessity.
Issue-ID: CCSDK-1950
Signed-off-by: Brinda Santh <bs2796@att.com>
Change-Id: Ibe6266ebfd399efbaf0c5ccb1019c3a73b08ddac
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds/designer-api/src/test')
-rw-r--r-- | ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt index 54dd46ef7..61f515017 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt @@ -68,6 +68,18 @@ class BluePrintManagementGRPCHandlerTest { } @Test + fun testBootstrap() { + val blockingStub = BluePrintManagementServiceGrpc.newBlockingStub(grpcServerRule.channel) + val id = "123_Bootstrap" + val req = createBootstrapInputRequest(id) + val bootstrapOutput = blockingStub.bootstrapBlueprint(req) + assertEquals(200, bootstrapOutput.status.code) + assertTrue(bootstrapOutput.status.message.contentEquals(BluePrintConstants.STATUS_SUCCESS), + "failed to get success status") + assertEquals(id, bootstrapOutput.commonHeader.requestId) + } + + @Test fun `test upload and download blueprint`() { val blockingStub = BluePrintManagementServiceGrpc.newBlockingStub(grpcServerRule.channel) val id = "123_upload" @@ -128,6 +140,21 @@ class BluePrintManagementGRPCHandlerTest { } } + private fun createBootstrapInputRequest(id: String): BluePrintBootstrapInput { + val commonHeader = CommonHeader + .newBuilder() + .setTimestamp("2012-04-23T18:25:43.511Z") + .setOriginatorId("System") + .setRequestId(id) + .setSubRequestId("1234-56").build() + + return BluePrintBootstrapInput.newBuilder() + .setCommonHeader(commonHeader) + .setLoadModelType(false) + .setLoadResourceDictionary(false) + .setLoadCBA(false) + .build() + } private fun createUploadInputRequest(id: String, action: String): BluePrintUploadInput { val file = normalizedFile("./src/test/resources/test-cba.zip") |