From be83f333fa4a9555be30c0484a89aa18aa991cd1 Mon Sep 17 00:00:00 2001 From: Neil South Date: Thu, 14 Dec 2023 16:18:18 +0000 Subject: [PATCH 1/3] adding missed validation and new test so it dont happen again" Signed-off-by: Neil South --- src/Messaging/Common/ArtifactTypes.cs | 1 + .../Tests/Common/ArtifactTypesTests.cs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/Messaging/Common/ArtifactTypes.cs b/src/Messaging/Common/ArtifactTypes.cs index bd1771b..51bccf5 100755 --- a/src/Messaging/Common/ArtifactTypes.cs +++ b/src/Messaging/Common/ArtifactTypes.cs @@ -22,6 +22,7 @@ public static class ArtifactTypes { { ArtifactType.Unset, "Unset" }, { ArtifactType.Folder, "Folders" }, + { ArtifactType.HL7, "HL7 message" }, { ArtifactType.AR, "Autorefract" }, { ArtifactType.ASMT, "Content Assessment Results" }, { ArtifactType.AU, "Audio" }, diff --git a/src/Messaging/Tests/Common/ArtifactTypesTests.cs b/src/Messaging/Tests/Common/ArtifactTypesTests.cs index 9f31b72..d665447 100755 --- a/src/Messaging/Tests/Common/ArtifactTypesTests.cs +++ b/src/Messaging/Tests/Common/ArtifactTypesTests.cs @@ -14,6 +14,7 @@ * limitations under the License. */ +using System; using Monai.Deploy.Messaging.Common; using Xunit; @@ -32,5 +33,21 @@ public void ArtifactTypeInvalid_ShouldReturnFalse() { Assert.False(ArtifactTypes.Validate("false")); } + + [Fact] + public void ArtifactTypeNull_ShouldReturnFalse() + { + Assert.False(ArtifactTypes.Validate(null)); + } + + [Fact] + public void ArtifactTypes_Should_Contain_All() + { + foreach (var artifactType in Enum.GetValues(typeof(ArtifactType))) + { + Assert.True(ArtifactTypes.ListOfModularity.ContainsKey((ArtifactType)artifactType)); + } + } + } } From 61f03a115452ec7fe911e15fed6e148ca94a6fd8 Mon Sep 17 00:00:00 2001 From: Neil South Date: Thu, 14 Dec 2023 16:21:25 +0000 Subject: [PATCH 2/3] another test Signed-off-by: Neil South --- src/Messaging/Tests/Common/ArtifactTypesTests.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Messaging/Tests/Common/ArtifactTypesTests.cs b/src/Messaging/Tests/Common/ArtifactTypesTests.cs index d665447..deb4d05 100755 --- a/src/Messaging/Tests/Common/ArtifactTypesTests.cs +++ b/src/Messaging/Tests/Common/ArtifactTypesTests.cs @@ -49,5 +49,11 @@ public void ArtifactTypes_Should_Contain_All() } } + [Fact] + public void ArtifactTypes_Should_Contain_Same_Count() + { + Assert.Equal(ArtifactTypes.ListOfModularity.Count, Enum.GetValues(typeof(ArtifactType)).Length); + } + } } From 787d025983f4cbdffe08645c3afba4128761e09f Mon Sep 17 00:00:00 2001 From: Neil South Date: Thu, 14 Dec 2023 16:27:49 +0000 Subject: [PATCH 3/3] fixing java Signed-off-by: Neil South --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml old mode 100644 new mode 100755 index c3fe5be..1e9a606 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,11 +94,11 @@ jobs: unit-test: runs-on: ubuntu-latest steps: - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - uses: actions/setup-dotnet@v3 with: