Skip to content

Commit

Permalink
rename isError and isWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
fhennig committed Nov 4, 2024
1 parent 2a22284 commit 6f7c757
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,14 @@ data class SequenceEntryStatus(
override val accession: Accession,
override val version: Version,
val status: Status,
val isError: Boolean,
val isWarning: Boolean,
/**
* Whether this sequence entry has any errors set from the processing.
*/
val hasErrors: Boolean,
/**
* Whether this sequence entry has any warnings set from the processing.
*/
val hasWarnings: Boolean,
val groupId: Int,
val submitter: String,
val isRevocation: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,8 @@ class SubmissionDatabaseService(
DataUseTermsType.fromString(row[DataUseTermsTable.dataUseTermsTypeColumn]),
row[DataUseTermsTable.restrictedUntilColumn],
),
isError = row[SequenceEntriesView.errorsColumn].orEmpty().isNotEmpty(),
isWarning = row[SequenceEntriesView.warningsColumn].orEmpty().isNotEmpty(),
hasErrors = row[SequenceEntriesView.errorsColumn].orEmpty().isNotEmpty(),
hasWarnings = row[SequenceEntriesView.warningsColumn].orEmpty().isNotEmpty(),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fun SequenceEntryStatus.assertStatusIs(status: Status): SequenceEntryStatus {
}

fun SequenceEntryStatus.assertHasError(error: Boolean): SequenceEntryStatus {
assertThat(this.isError, `is`(error))
assertThat(this.hasErrors, `is`(error))
return this
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ class CitationEndpointsTest(@Autowired private val client: SeqSetCitationsContro
isRevocation = false,
submissionId = "mock-submission-id",
dataUseTerms = DataUseTerms.Open,
isError = false,
isWarning = false,
hasErrors = false,
hasWarnings = false,
),
),
statusCounts = mapOf(Status.APPROVED_FOR_RELEASE to 1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class GetSequencesEndpointTest(
sequencesOfUser.find { it.accession == accessions.first() && it.version == scenario.expectedVersion }
assertThat(accessionVersionStatus?.status, `is`(scenario.expectedStatus))
assertThat(accessionVersionStatus?.isRevocation, `is`(scenario.expectedIsRevocation))
assertThat(accessionVersionStatus?.isError, `is`(scenario.expectedErrors))
assertThat(accessionVersionStatus?.hasErrors, `is`(scenario.expectedErrors))
}

companion object {
Expand Down

0 comments on commit 6f7c757

Please sign in to comment.