From 5e9bd2a7e776d54dc229c4cca6a9a12fbb34a8f4 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Fri, 18 Oct 2024 10:15:24 -0500 Subject: [PATCH] CE-1887 Adding test coverage! --- .../DistinctFilteringRecordPipeTest.java | 81 +++++++++++++++++++ .../reporting/GenerateReportActionTest.java | 65 ++++++++++++++- ...oldHeaderAndFooterFastExcelStylerTest.java | 52 ++++++++++++ .../actions/scripts/QCodeExecutorTest.java | 60 ++++++++++++++ ...taDataProducerBasedQQQApplicationTest.java | 65 +++++++++++++++ .../instances/AbstractQQQApplicationTest.java | 74 +++++++++++++++++ .../producers/TestMetaDataProducer.java | 46 +++++++++++ .../email/EmailMessagingProviderTest.java | 16 ++++ .../RenderSavedReportProcessTest.java | 16 +++- 9 files changed, 471 insertions(+), 4 deletions(-) create mode 100644 qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/DistinctFilteringRecordPipeTest.java create mode 100644 qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/excel/fastexcel/BoldHeaderAndFooterFastExcelStylerTest.java create mode 100644 qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/scripts/QCodeExecutorTest.java create mode 100644 qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/AbstractMetaDataProducerBasedQQQApplicationTest.java create mode 100644 qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/AbstractQQQApplicationTest.java create mode 100644 qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/producers/TestMetaDataProducer.java diff --git a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/DistinctFilteringRecordPipeTest.java b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/DistinctFilteringRecordPipeTest.java new file mode 100644 index 00000000..9d651f2a --- /dev/null +++ b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/DistinctFilteringRecordPipeTest.java @@ -0,0 +1,81 @@ +/* + * QQQ - Low-code Application Framework for Engineers. + * Copyright (C) 2021-2024. Kingsrook, LLC + * 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States + * contact@kingsrook.com + * https://github.com/Kingsrook/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package com.kingsrook.qqq.backend.core.actions.reporting; + + +import com.kingsrook.qqq.backend.core.BaseTest; +import com.kingsrook.qqq.backend.core.exceptions.QException; +import com.kingsrook.qqq.backend.core.model.data.QRecord; +import com.kingsrook.qqq.backend.core.model.metadata.tables.UniqueKey; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + + +/******************************************************************************* + ** Unit test for DistinctFilteringRecordPipe + *******************************************************************************/ +class DistinctFilteringRecordPipeTest extends BaseTest +{ + + /******************************************************************************* + ** + *******************************************************************************/ + @Test + void testSingleFieldKey() throws QException + { + DistinctFilteringRecordPipe pipe = new DistinctFilteringRecordPipe(new UniqueKey("id")); + pipe.addRecord(new QRecord().withValue("id", 1)); + pipe.addRecord(new QRecord().withValue("id", 1)); + assertEquals(1, pipe.consumeAvailableRecords().size()); + + pipe.addRecord(new QRecord().withValue("id", 1)); + assertEquals(0, pipe.consumeAvailableRecords().size()); + } + + + /******************************************************************************* + ** + *******************************************************************************/ + @Test + void testMultiFieldKey() throws QException + { + DistinctFilteringRecordPipe pipe = new DistinctFilteringRecordPipe(new UniqueKey("type", "name")); + + //////////////////////////// + // add 3 distinct records // + //////////////////////////// + pipe.addRecord(new QRecord().withValue("type", 1).withValue("name", "A")); + pipe.addRecord(new QRecord().withValue("type", 1).withValue("name", "B")); + pipe.addRecord(new QRecord().withValue("type", 2).withValue("name", "B")); + assertEquals(3, pipe.consumeAvailableRecords().size()); + + /////////////////////////////////////////////////////////////////// + // now re-add those 3 (should all be discarded) plus one new one // + /////////////////////////////////////////////////////////////////// + pipe.addRecord(new QRecord().withValue("type", 1).withValue("name", "A")); + pipe.addRecord(new QRecord().withValue("type", 1).withValue("name", "B")); + pipe.addRecord(new QRecord().withValue("type", 2).withValue("name", "B")); + pipe.addRecord(new QRecord().withValue("type", 2).withValue("name", "A")); + assertEquals(1, pipe.consumeAvailableRecords().size()); + } + +} \ No newline at end of file diff --git a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/GenerateReportActionTest.java b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/GenerateReportActionTest.java index 1cf8404a..03db7e79 100644 --- a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/GenerateReportActionTest.java +++ b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/GenerateReportActionTest.java @@ -32,6 +32,7 @@ import java.nio.charset.StandardCharsets; import java.time.LocalDate; import java.time.Month; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -80,6 +81,7 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -340,6 +342,16 @@ public class GenerateReportActionTest extends BaseTest ** *******************************************************************************/ private String runToString(ReportFormat reportFormat, String reportName) throws Exception + { + return (runToString(reportFormat, reportName, Map.of("startDate", LocalDate.of(1970, Month.MAY, 15), "endDate", LocalDate.now()))); + } + + + + /******************************************************************************* + ** + *******************************************************************************/ + private String runToString(ReportFormat reportFormat, String reportName, Map inputValues) throws Exception { String name = "/tmp/report." + reportFormat.getExtension(); try(FileOutputStream fileOutputStream = new FileOutputStream(name)) @@ -347,7 +359,7 @@ public class GenerateReportActionTest extends BaseTest ReportInput reportInput = new ReportInput(); reportInput.setReportName(reportName); reportInput.setReportDestination(new ReportDestination().withReportFormat(reportFormat).withReportOutputStream(fileOutputStream)); - reportInput.setInputValues(Map.of("startDate", LocalDate.of(1970, Month.MAY, 15), "endDate", LocalDate.now())); + reportInput.setInputValues(inputValues); new GenerateReportAction().execute(reportInput); System.out.println("Wrote File: " + name); return (FileUtils.readFileToString(new File(name), StandardCharsets.UTF_8)); @@ -976,4 +988,55 @@ public class GenerateReportActionTest extends BaseTest assertThat(row.get("Home State Name")).isEqualTo("IL"); } + + + /******************************************************************************* + ** + *******************************************************************************/ + @Test + void testFilterMissingValue() throws Exception + { + ////////////////////////////////////////////////////////////////////////////////////////////////////// + // define a report in the instance, with an input field - then we'll run it w/o supplying the value // + ////////////////////////////////////////////////////////////////////////////////////////////////////// + QReportMetaData report = new QReportMetaData() + .withName(REPORT_NAME) + .withDataSources(List.of( + new QReportDataSource() + .withName("persons") + .withSourceTable(TestUtils.TABLE_NAME_PERSON_MEMORY) + .withQueryFilter(new QQueryFilter() + .withCriteria(new QFilterCriteria("birthDate", QCriteriaOperator.GREATER_THAN, List.of("${input.startDate}")))))) + .withViews(List.of( + new QReportView() + .withName("table1") + .withLabel("Table 1") + .withDataSourceName("persons") + .withType(ReportType.TABLE) + .withColumns(List.of(new QReportField().withName("id"))) + )); + + QInstance qInstance = QContext.getQInstance(); + qInstance.addReport(report); + + ////////////////////////////////////////////////////////////////////////////////////////////////// + // the report should run, but with the filter removed, so it should find all (6) person records // + ////////////////////////////////////////////////////////////////////////////////////////////////// + insertPersonRecords(qInstance); + String json = runToString(ReportFormat.JSON, report.getName(), Collections.emptyMap()); + JSONArray reportJsonArray = new JSONArray(json); + assertEquals(6, reportJsonArray.length()); + + ///////////////////////////////////////////////////////////////////////////////////////////// + // re-run now, pretending to be a report that wasn't defined in meta-data, but instead was // + // ah-hoc-style, in which case, a missing input is defined as, should throw exception. // + ///////////////////////////////////////////////////////////////////////////////////////////// + ReportInput reportInput = new ReportInput(); + report.setName(null); + reportInput.setReportMetaData(report); + reportInput.setReportDestination(new ReportDestination().withReportFormat(ReportFormat.JSON).withReportOutputStream(new ByteArrayOutputStream())); + assertThatThrownBy(() -> new GenerateReportAction().execute(reportInput)) + .hasMessageContaining("Missing value for criteria on field: birthDate"); + } + } \ No newline at end of file diff --git a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/excel/fastexcel/BoldHeaderAndFooterFastExcelStylerTest.java b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/excel/fastexcel/BoldHeaderAndFooterFastExcelStylerTest.java new file mode 100644 index 00000000..13b37fa9 --- /dev/null +++ b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/reporting/excel/fastexcel/BoldHeaderAndFooterFastExcelStylerTest.java @@ -0,0 +1,52 @@ +/* + * QQQ - Low-code Application Framework for Engineers. + * Copyright (C) 2021-2024. Kingsrook, LLC + * 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States + * contact@kingsrook.com + * https://github.com/Kingsrook/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package com.kingsrook.qqq.backend.core.actions.reporting.excel.fastexcel; + + +import java.io.ByteArrayOutputStream; +import com.kingsrook.qqq.backend.core.BaseTest; +import org.dhatim.fastexcel.StyleSetter; +import org.dhatim.fastexcel.Workbook; +import org.dhatim.fastexcel.Worksheet; +import org.junit.jupiter.api.Test; + + +/******************************************************************************* + ** Unit test for BoldHeaderAndFooterFastExcelStyler + *******************************************************************************/ +class BoldHeaderAndFooterFastExcelStylerTest extends BaseTest +{ + + /******************************************************************************* + ** ... kinda just here to add test coverage to the class. I suppose, it + ** makes sure there's not an NPE inside that method at least...? + *******************************************************************************/ + @Test + void test() + { + Workbook workbook = new Workbook(new ByteArrayOutputStream(), "Test", null); + Worksheet worksheet = workbook.newWorksheet("Sheet 1"); + StyleSetter headerStyle = worksheet.range(0, 0, 1, 1).style(); + new BoldHeaderAndFooterFastExcelStyler().styleHeaderRow(headerStyle); + } + +} \ No newline at end of file diff --git a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/scripts/QCodeExecutorTest.java b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/scripts/QCodeExecutorTest.java new file mode 100644 index 00000000..3434052b --- /dev/null +++ b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/actions/scripts/QCodeExecutorTest.java @@ -0,0 +1,60 @@ +/* + * QQQ - Low-code Application Framework for Engineers. + * Copyright (C) 2021-2024. Kingsrook, LLC + * 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States + * contact@kingsrook.com + * https://github.com/Kingsrook/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package com.kingsrook.qqq.backend.core.actions.scripts; + + +import com.kingsrook.qqq.backend.core.BaseTest; +import com.kingsrook.qqq.backend.core.exceptions.QCodeException; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertSame; + + +/******************************************************************************* + ** Unit test for QCodeExecutor + *******************************************************************************/ +class QCodeExecutorTest extends BaseTest +{ + + /******************************************************************************* + ** + *******************************************************************************/ + @Test + void testConvertJavaObject() throws QCodeException + { + Object input = new Object(); + Object converted = ((QCodeExecutor) (codeReference, inputContext, executionLogger) -> null).convertJavaObject(input, null); + assertSame(input, converted); + } + + + /******************************************************************************* + ** + *******************************************************************************/ + @Test + void testConvertObjectToJava() throws QCodeException + { + Object input = new Object(); + Object converted = ((QCodeExecutor) (codeReference, inputContext, executionLogger) -> null).convertObjectToJava(input); + assertSame(input, converted); + } + +} \ No newline at end of file diff --git a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/AbstractMetaDataProducerBasedQQQApplicationTest.java b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/AbstractMetaDataProducerBasedQQQApplicationTest.java new file mode 100644 index 00000000..d5321bcc --- /dev/null +++ b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/AbstractMetaDataProducerBasedQQQApplicationTest.java @@ -0,0 +1,65 @@ +/* + * QQQ - Low-code Application Framework for Engineers. + * Copyright (C) 2021-2024. Kingsrook, LLC + * 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States + * contact@kingsrook.com + * https://github.com/Kingsrook/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package com.kingsrook.qqq.backend.core.instances; + + +import com.kingsrook.qqq.backend.core.BaseTest; +import com.kingsrook.qqq.backend.core.exceptions.QException; +import com.kingsrook.qqq.backend.core.model.metadata.QInstance; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + + +/******************************************************************************* + ** Unit test for AbstractMetaDataProducerBasedQQQApplication + *******************************************************************************/ +class AbstractMetaDataProducerBasedQQQApplicationTest extends BaseTest +{ + + /******************************************************************************* + ** + *******************************************************************************/ + @Test + void test() throws QException + { + QInstance qInstance = new TestApplication().defineQInstance(); + assertEquals(1, qInstance.getTables().size()); + } + + + + /*************************************************************************** + ** + ***************************************************************************/ + public static class TestApplication extends AbstractMetaDataProducerBasedQQQApplication + { + + /*************************************************************************** + ** + ***************************************************************************/ + @Override + public String getMetaDataPackageName() + { + return getClass().getPackage().getName() + ".producers"; + } + } +} \ No newline at end of file diff --git a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/AbstractQQQApplicationTest.java b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/AbstractQQQApplicationTest.java new file mode 100644 index 00000000..59288f64 --- /dev/null +++ b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/AbstractQQQApplicationTest.java @@ -0,0 +1,74 @@ +/* + * QQQ - Low-code Application Framework for Engineers. + * Copyright (C) 2021-2024. Kingsrook, LLC + * 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States + * contact@kingsrook.com + * https://github.com/Kingsrook/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package com.kingsrook.qqq.backend.core.instances; + + +import com.kingsrook.qqq.backend.core.BaseTest; +import com.kingsrook.qqq.backend.core.exceptions.QException; +import com.kingsrook.qqq.backend.core.model.metadata.QInstance; +import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData; +import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + + +/******************************************************************************* + ** Unit test for AbstractQQQApplication + *******************************************************************************/ +class AbstractQQQApplicationTest extends BaseTest +{ + + /******************************************************************************* + ** + *******************************************************************************/ + @Test + void test() throws QException + { + TestApplication testApplication = new TestApplication(); + QInstance qInstance = testApplication.defineQInstance(); + assertEquals(1, qInstance.getTables().size()); + assertTrue(qInstance.getTables().containsKey("testTable")); + + assertThatThrownBy(() -> testApplication.defineValidatedQInstance()) + .hasMessageContaining("validation"); + } + + + + /*************************************************************************** + ** + ***************************************************************************/ + public static class TestApplication extends AbstractQQQApplication + { + /*************************************************************************** + ** + ***************************************************************************/ + @Override + public QInstance defineQInstance() throws QException + { + QInstance qInstance = new QInstance(); + qInstance.addTable(new QTableMetaData().withName("testTable")); + return (qInstance); + } + } +} \ No newline at end of file diff --git a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/producers/TestMetaDataProducer.java b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/producers/TestMetaDataProducer.java new file mode 100644 index 00000000..66e57b9b --- /dev/null +++ b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/instances/producers/TestMetaDataProducer.java @@ -0,0 +1,46 @@ +/* + * QQQ - Low-code Application Framework for Engineers. + * Copyright (C) 2021-2024. Kingsrook, LLC + * 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States + * contact@kingsrook.com + * https://github.com/Kingsrook/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package com.kingsrook.qqq.backend.core.instances.producers; + + +import com.kingsrook.qqq.backend.core.exceptions.QException; +import com.kingsrook.qqq.backend.core.model.metadata.MetaDataProducerInterface; +import com.kingsrook.qqq.backend.core.model.metadata.QInstance; +import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData; + + +/******************************************************************************* + ** + *******************************************************************************/ +public class TestMetaDataProducer implements MetaDataProducerInterface +{ + + /*************************************************************************** + ** + ***************************************************************************/ + @Override + public QTableMetaData produce(QInstance qInstance) throws QException + { + return new QTableMetaData().withName("fromProducer"); + } + +} diff --git a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/model/metadata/messaging/email/EmailMessagingProviderTest.java b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/model/metadata/messaging/email/EmailMessagingProviderTest.java index 3f008fd7..20d9ac84 100644 --- a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/model/metadata/messaging/email/EmailMessagingProviderTest.java +++ b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/model/metadata/messaging/email/EmailMessagingProviderTest.java @@ -35,6 +35,7 @@ import com.kingsrook.qqq.backend.core.utils.TestUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.condition.OS; +import static org.assertj.core.api.Assertions.assertThatThrownBy; /******************************************************************************* @@ -64,4 +65,19 @@ class EmailMessagingProviderTest extends BaseTest ); } + + + /******************************************************************************* + ** + *******************************************************************************/ + @Test + void testMissingInputs() + { + assertThatThrownBy(() -> new SendMessageAction().execute(new SendMessageInput())) + .hasMessageContaining("provider name was not given"); + + assertThatThrownBy(() -> new SendMessageAction().execute(new SendMessageInput().withMessagingProviderName("notFound"))) + .hasMessageContaining("was not found"); + } + } diff --git a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/processes/implementations/savedreports/RenderSavedReportProcessTest.java b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/processes/implementations/savedreports/RenderSavedReportProcessTest.java index 3e6efae7..3a5523d8 100644 --- a/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/processes/implementations/savedreports/RenderSavedReportProcessTest.java +++ b/qqq-backend-core/src/test/java/com/kingsrook/qqq/backend/core/processes/implementations/savedreports/RenderSavedReportProcessTest.java @@ -161,9 +161,19 @@ class RenderSavedReportProcessTest extends BaseTest *******************************************************************************/ private static InputStream getInputStream(RunProcessOutput runProcessOutput) throws QException { - String storageTableName = runProcessOutput.getValueString("storageTableName"); - String storageReference = runProcessOutput.getValueString("storageReference"); - InputStream inputStream = new MemoryStorageAction().getInputStream(new StorageInput(storageTableName).withReference(storageReference)); + String storageTableName = runProcessOutput.getValueString("storageTableName"); + String storageReference = runProcessOutput.getValueString("storageReference"); + + MemoryStorageAction memoryStorageAction = new MemoryStorageAction(); + StorageInput storageInput = new StorageInput(storageTableName).withReference(storageReference); + InputStream inputStream = memoryStorageAction.getInputStream(storageInput); + + ///////////////////////////////////////////////////////////////////////////////////////////////////// + // to help add a little bit of class-level code coverage, for the QStorageInterface, call a method // + // that has a defualt implementation in there // + ///////////////////////////////////////////////////////////////////////////////////////////////////// + memoryStorageAction.getDownloadURL(storageInput); + return inputStream; }