+ @Test
+ public void should_throw_exception_on_get_download_config_failure() throws SvcLogicException {
+ inParams.put(AppcDataServiceConstant.INPUT_PARAM_RESPONSE_PREFIX, "some prefix");
+
+ DGGeneralDBService dbServiceMock = new MockDbServiceBuilder()
+ .getDownloadConfigTemplateByVnf("some prefix", SvcLogicResource.QueryStatus.FAILURE)
+ .build();
+
+ ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock);
+
+ expectedException.expect(SvcLogicException.class);
+ expectedException.expectMessage("Unable to get download config template.");
+ configResourceNode.getDownloadConfigTemplateByVnf(inParams, contextMock);
+ }
+
+ @Test
+ public void should_throw_exception_on_get_ssm_chain_failure() throws SvcLogicException {
+ when(contextMock.getAttribute(SITE_LOCATION_PARAM)).thenReturn("some location");
+
+ DGGeneralDBService dbServiceMock = new MockDbServiceBuilder()
+ .getTemplateByArtifactType("smm", "smm", "some location", SvcLogicResource.QueryStatus.FAILURE)
+ .build();
+
+ ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock);
+
+ expectedException.expect(SvcLogicException.class);
+ expectedException.expectMessage("Unable to Read smm file");
+ configResourceNode.getSmmChainKeyFiles(inParams, contextMock);
+ }
+
+ @Test
+ public void should_throw_exception_on_get_ca_chain_failure() throws SvcLogicException {
+ when(contextMock.getAttribute(SITE_LOCATION_PARAM)).thenReturn("some location");
+
+ DGGeneralDBService dbServiceMock = new MockDbServiceBuilder()
+ .getTemplateByArtifactType("intermediate-ca-chain", "intermediate_ca_chain", "some location", SvcLogicResource.QueryStatus.FAILURE)
+ .build();
+
+ ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock);
+
+ expectedException.expect(SvcLogicException.class);
+ expectedException.expectMessage("Unable to Read intermediate_ca_chain file");
+ configResourceNode.getSmmChainKeyFiles(inParams, contextMock);
+ }
+
+ @Test
+ public void should_throw_exception_on_get_server_certificate_and_key_failure() throws SvcLogicException {
+ when(contextMock.getAttribute(SITE_LOCATION_PARAM)).thenReturn("some location");
+
+ DGGeneralDBService dbServiceMock = new MockDbServiceBuilder()
+ .getTemplateByArtifactType("server-certificate-and-key", "server_certificate_and_key", "some location", SvcLogicResource.QueryStatus.FAILURE)
+ .build();
+
+ ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock);
+
+ expectedException.expect(SvcLogicException.class);
+ expectedException.expectMessage("Unable to Read server_certificate_and_key file");
+ configResourceNode.getSmmChainKeyFiles(inParams, contextMock);
+ }
+