CE-604 Update test per change in ProcessSummaryWarningsAndErrorsRollup (also, fix bug in it (thanks test) where warnings were changing to errors during the doReplaceSingletonCountLinesWithSuffixOnly thing)

This commit is contained in:
2023-10-20 12:33:17 -05:00
parent a5b18c9020
commit a19a789449
2 changed files with 6 additions and 4 deletions

View File

@ -271,7 +271,7 @@ public class ProcessSummaryWarningsAndErrorsRollup
{
if(psl.getCount() == 1)
{
return (new ProcessSummaryRecordLink().withStatus(Status.ERROR).withLinkPreText(psl.getMessageSuffix()));
return (new ProcessSummaryRecordLink().withStatus(psl.getStatus()).withLinkPreText(psl.getMessageSuffix()));
}
}

View File

@ -32,6 +32,8 @@ import com.kingsrook.qqq.backend.core.actions.processes.RunProcessAction;
import com.kingsrook.qqq.backend.core.context.QContext;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.actions.processes.ProcessSummaryLine;
import com.kingsrook.qqq.backend.core.model.actions.processes.ProcessSummaryLineInterface;
import com.kingsrook.qqq.backend.core.model.actions.processes.ProcessSummaryRecordLink;
import com.kingsrook.qqq.backend.core.model.actions.processes.RunProcessInput;
import com.kingsrook.qqq.backend.core.model.actions.processes.RunProcessOutput;
import com.kingsrook.qqq.backend.core.model.actions.processes.Status;
@ -310,7 +312,7 @@ class BulkEditTest extends BaseTest
runProcessOutput = new RunProcessAction().execute(runProcessInput);
@SuppressWarnings("unchecked")
List<ProcessSummaryLine> processSummaryLines = (List<ProcessSummaryLine>) runProcessOutput.getValues().get(StreamedETLWithFrontendProcess.FIELD_PROCESS_SUMMARY);
List<ProcessSummaryLineInterface> processSummaryLines = (List<ProcessSummaryLineInterface>) runProcessOutput.getValues().get(StreamedETLWithFrontendProcess.FIELD_PROCESS_SUMMARY);
assertThat(processSummaryLines).hasSize(1 + 50 + 1 + 30 + 1);
int index = 0;
@ -323,7 +325,7 @@ class BulkEditTest extends BaseTest
{
assertThat(processSummaryLines.get(index++))
.hasFieldOrPropertyWithValue("status", Status.ERROR)
.hasFieldOrPropertyWithValue("count", 1)
.isInstanceOf(ProcessSummaryRecordLink.class) // this is because it's a singleton, so we get rid of the "1 had an error" thing (doReplaceSingletonCountLinesWithSuffixOnly)
.matches(psl -> psl.getMessage().contains("less than 60 is error"), "expected message");
}
@ -336,7 +338,7 @@ class BulkEditTest extends BaseTest
{
assertThat(processSummaryLines.get(index++))
.hasFieldOrPropertyWithValue("status", Status.WARNING)
.hasFieldOrPropertyWithValue("count", 1)
.isInstanceOf(ProcessSummaryRecordLink.class) // this is because it's a singleton, so we get rid of the "1 had an error" thing (doReplaceSingletonCountLinesWithSuffixOnly)
.matches(psl -> psl.getMessage().contains("less than 90 is warning"), "expected message");
}