+ @Test
+ public void should_throw_exception_on_save_config_failure() throws SvcLogicException {
+ SvcLogicContext context = new SvcLogicContext();
+ context.setAttribute(FILE_CATEGORY_PARAM, "some file category");
+
+ DGGeneralDBService dbServiceMock = new MockDbServiceBuilder()
+ .saveConfigFiles(CONFIG_FILES_PREFIX, SvcLogicResource.QueryStatus.FAILURE)
+ .build();
+
+ ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock);
+
+ expectedException.expect(SvcLogicException.class);
+ expectedException.expectMessage("Unable to Save some file category in configfiles");
+ configResourceNode.saveConfigFiles(inParams, context);
+ }
+
+ @Test
+ public void should_throw_exception_on_get_max_config_id_missing() throws SvcLogicException {
+ SvcLogicContext context = new SvcLogicContext();
+ context.setAttribute(FILE_CATEGORY_PARAM, "some file category");
+
+ DGGeneralDBService dbServiceMock = new MockDbServiceBuilder()
+ .getMaxConfigFileId(MAX_CONF_FILE_PREFIX, "some file category", SvcLogicResource.QueryStatus.NOT_FOUND)
+ .build();
+
+ ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock);
+
+ expectedException.expect(SvcLogicException.class);
+ expectedException.expectMessage("Unable to get some file category from configfiles");
+
+ configResourceNode.saveConfigFiles(inParams, context);
+ }
+
+ @Test
+ public void should_throw_exception_on_save_config_files_failure() throws SvcLogicException {
+ SvcLogicContext context = new SvcLogicContext();
+ context.setAttribute(CONFIG_FILE_ID_PARAM, "some file id");
+
+ DGGeneralDBService dbServiceMock = new MockDbServiceBuilder()
+ .savePrepareRelationship(PREPARE_RELATIONSHIP_PARAM, "some file id", SDC_IND, SvcLogicResource.QueryStatus.FAILURE)
+ .build();
+
+ ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock);
+
+ expectedException.expect(SvcLogicException.class);
+ expectedException.expectMessage("Unable to save prepare_relationship");
+ configResourceNode.saveConfigFiles(inParams, context);
+ }
+