From 27cacfee7a959739b3bf147f274b0cdd534bc01b Mon Sep 17 00:00:00 2001
From: ao508 <15623749+ao508@users.noreply.github.com>
Date: Fri, 15 Nov 2024 15:52:02 -0500
Subject: [PATCH] Update SMILE dependencies to 2.0.0.RELEASE (#81)
* Update to java21
General updates:
- Support java21
- Spring framework and spring boot updates
- Updated test layer to junit-jupiter
- Updated circleci config
Signed-off-by: Angelica Ochoa <15623749+ao508@users.noreply.github.com>
* Update SMILE dependencies to 2.0.0.RELEASE
Signed-off-by: Angelica Ochoa <15623749+ao508@users.noreply.github.com>
---------
Signed-off-by: Angelica Ochoa <15623749+ao508@users.noreply.github.com>
---
.circleci/config.yml | 4 +-
Dockerfile | 4 +-
jitpack.yml | 9 +++
pom.xml | 52 +++++++-----------
.../LabelGenMessageHandlingServiceImpl.java | 18 +++---
.../impl/RequestReplyHandlingServiceImpl.java | 6 +-
.../smile/CmoLabelGeneratorServiceTest.java | 55 +++++++++----------
.../mskcc/smile/LabelGeneratorTestApp.java | 23 ++++++++
.../PortedLimsRestCmoLabelGenerationTest.java | 49 ++++++++---------
9 files changed, 118 insertions(+), 102 deletions(-)
create mode 100644 jitpack.yml
create mode 100644 src/test/java/org/mskcc/smile/LabelGeneratorTestApp.java
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 6ffb6b4..434917b 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,11 +1,11 @@
defaults: &defaults
docker:
- - image: cimg/openjdk:8.0.275
+ - image: cimg/openjdk:21.0
version: 2.1
orbs:
- maven: circleci/maven@1.0.3
+ maven: circleci/maven@1.4.1
jobs:
run_checkstyle:
diff --git a/Dockerfile b/Dockerfile
index 50ef394..4cf3bb8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM maven:3.6.1-jdk-11-slim
+FROM maven:3.8.8
# create working directory and set
RUN mkdir /label-generator
ADD . /label-generator
@@ -6,6 +6,6 @@ WORKDIR /label-generator
RUN mvn clean install
# copy jar and set entrypoint
-FROM openjdk:11-slim
+FROM openjdk:21
COPY --from=0 /label-generator/target/smile_label_generator.jar /label-generator/smile_label_generator.jar
ENTRYPOINT ["java"]
diff --git a/jitpack.yml b/jitpack.yml
new file mode 100644
index 0000000..9d14120
--- /dev/null
+++ b/jitpack.yml
@@ -0,0 +1,9 @@
+jdk:
+ - openjdk21
+
+before_install:
+ - sdk install maven 3.8.8
+ - sdk use maven 3.8.8
+ - sdk install java 21.0.2-open
+ - sdk use java 21.0.2-open
+ - sdk update
diff --git a/pom.xml b/pom.xml
index 93103a7..31b6bf3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.3.3.RELEASE
+ 3.3.3
@@ -29,21 +29,20 @@
- 1.8
- 1.8
- 5.2.6.RELEASE
- 2.3.3.RELEASE
- 1.7.30
- 2.11.2
+ 21
+ 3.11.0
+ 6.1.12
+ 3.3.3
+ 2.17.2
com.github.mskcc
- 1.4.1.RELEASE
+ 2.0.0.RELEASE
com.github.mskcc
- 1.4.1.RELEASE
+ 2.0.0.RELEASE
com.github.mskcc.smile-server
- 1.6.0.RELEASE
+ 2.0.0.RELEASE
@@ -72,20 +71,21 @@
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter-api
+ 5.10.3
test
+ jar
- org.springframework
- spring-test
- ${spring.version}
+ org.springframework.boot
+ spring-boot-test
+ ${spring.boot.version}
test
org.mockito
mockito-core
- 3.3.3
test
jar
@@ -99,19 +99,7 @@
org.skyscreamer
jsonassert
- 1.5.0
-
-
-
- com.google.guava
- guava
- 19.0
- jar
-
-
- org.apache.commons
- commons-lang3
- 3.11
+ 1.5.3
@@ -144,10 +132,10 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.6.1
+ ${maven.compiler.version}
-
- ${maven.compiler.version}
+
+ ${java.version}
-Xlint:deprecation
diff --git a/src/main/java/org/mskcc/smile/service/impl/LabelGenMessageHandlingServiceImpl.java b/src/main/java/org/mskcc/smile/service/impl/LabelGenMessageHandlingServiceImpl.java
index d474e98..29878d3 100644
--- a/src/main/java/org/mskcc/smile/service/impl/LabelGenMessageHandlingServiceImpl.java
+++ b/src/main/java/org/mskcc/smile/service/impl/LabelGenMessageHandlingServiceImpl.java
@@ -39,31 +39,31 @@
@Service
public class LabelGenMessageHandlingServiceImpl implements MessageHandlingService {
- @Value("${igo.cmo_label_generator_topic}")
+ @Value("${igo.cmo_label_generator_topic:}")
private String CMO_LABEL_GENERATOR_TOPIC;
- @Value("${igo.cmo_promoted_label_topic}")
+ @Value("${igo.cmo_promoted_label_topic:}")
private String CMO_PROMOTED_LABEL_TOPIC;
- @Value("${igo.new_request_topic}")
+ @Value("${igo.new_request_topic:}")
private String IGO_NEW_REQUEST_TOPIC;
- @Value("${igo.promoted_request_topic}")
+ @Value("${igo.promoted_request_topic:}")
private String IGO_PROMOTED_REQUEST_TOPIC;
- @Value("${igo.cmo_sample_label_update_topic}")
+ @Value("${igo.cmo_sample_label_update_topic:}")
private String CMO_LABEL_UPDATE_TOPIC;
- @Value("${smile.sample_update_topic}")
+ @Value("${smile.sample_update_topic:}")
private String IGO_SAMPLE_UPDATE_TOPIC;
- @Value("${num.new_request_handler_threads}")
+ @Value("${num.new_request_handler_threads:1}")
private int NUM_NEW_REQUEST_HANDLERS;
- @Value("${num.promoted_request_handler_threads}")
+ @Value("${num.promoted_request_handler_threads:1}")
private int NUM_PROMOTED_REQUEST_HANDLERS;
- @Value("${request_reply.patient_samples_topic}")
+ @Value("${request_reply.patient_samples_topic:}")
private String PATIENT_SAMPLES_REQUEST_TOPIC;
@Autowired
diff --git a/src/main/java/org/mskcc/smile/service/impl/RequestReplyHandlingServiceImpl.java b/src/main/java/org/mskcc/smile/service/impl/RequestReplyHandlingServiceImpl.java
index cedd446..3cd6d26 100644
--- a/src/main/java/org/mskcc/smile/service/impl/RequestReplyHandlingServiceImpl.java
+++ b/src/main/java/org/mskcc/smile/service/impl/RequestReplyHandlingServiceImpl.java
@@ -32,13 +32,13 @@
@Service
public class RequestReplyHandlingServiceImpl implements RequestReplyHandlingService {
- @Value("${request_reply.cmo_label_generator_topic}")
+ @Value("${request_reply.cmo_label_generator_topic:}")
private String CMO_LABEL_GENERATOR_REQREPLY_TOPIC;
- @Value("${request_reply.patient_samples_topic}")
+ @Value("${request_reply.patient_samples_topic:}")
private String PATIENT_SAMPLES_REQUEST_TOPIC;
- @Value("${num.new_request_handler_threads}")
+ @Value("${num.new_request_handler_threads:1}")
private int NUM_NEW_REQUEST_HANDLERS;
@Autowired
diff --git a/src/test/java/org/mskcc/smile/CmoLabelGeneratorServiceTest.java b/src/test/java/org/mskcc/smile/CmoLabelGeneratorServiceTest.java
index 0ed4cfa..bd1684c 100644
--- a/src/test/java/org/mskcc/smile/CmoLabelGeneratorServiceTest.java
+++ b/src/test/java/org/mskcc/smile/CmoLabelGeneratorServiceTest.java
@@ -7,9 +7,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import junit.framework.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
import org.mskcc.smile.commons.enums.NucleicAcid;
import org.mskcc.smile.commons.enums.SpecimenType;
import org.mskcc.smile.config.TestConfiguration;
@@ -19,13 +18,11 @@
import org.mskcc.smile.model.igo.IgoSampleManifest;
import org.mskcc.smile.service.CmoLabelGeneratorService;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Import;
-@ContextConfiguration(classes = TestConfiguration.class)
-@RunWith(SpringJUnit4ClassRunner.class)
-@ComponentScan("org.mskcc.smile.service")
+@SpringBootTest(classes = LabelGeneratorTestApp.class)
+@Import(TestConfiguration.class)
public class CmoLabelGeneratorServiceTest {
private final ObjectMapper mapper = new ObjectMapper();
@@ -40,7 +37,7 @@ public class CmoLabelGeneratorServiceTest {
*/
@Test
public void testMockedRequestJsonDataLoading() {
- Assert.assertNotNull(mockedRequestJsonDataMap);
+ Assertions.assertNotNull(mockedRequestJsonDataMap);
}
/**
@@ -52,7 +49,7 @@ public void testValidRequestJson() throws Exception {
MockJsonTestData requestJson = mockedRequestJsonDataMap
.get("mockIncomingRequest1JsonDataWith2T2N");
String modifiedRequestJson = requestJson.getJsonString();
- Assert.assertNotNull(modifiedRequestJson);
+ Assertions.assertNotNull(modifiedRequestJson);
}
/**
@@ -89,12 +86,12 @@ public void testCmoLabelGenForSampleUpdate() throws JsonProcessingException,
String newCmoLabel = cmoLabelGeneratorService.generateCmoSampleLabel(
updatedSample, existingSamples);
// if the cmo label before the update is C-MP789JR-X001-d
- Assert.assertEquals("C-MP789JR-P003-d02", newCmoLabel);
+ Assertions.assertEquals("C-MP789JR-P003-d02", newCmoLabel);
Status sampleStatus = cmoLabelGeneratorService.generateSampleStatus(
updatedSample, existingSamples);
- Assert.assertEquals(Boolean.TRUE, sampleStatus.getValidationStatus());
- Assert.assertEquals(sampleStatus.getValidationReport(), (new HashMap()).toString());
+ Assertions.assertEquals(Boolean.TRUE, sampleStatus.getValidationStatus());
+ Assertions.assertEquals(sampleStatus.getValidationReport(), (new HashMap()).toString());
}
/**
@@ -135,12 +132,12 @@ public void testCmoLabelGenForSampleWithPatientCorrection()
updatedSample, existingSamples);
// if the cmo label before the update is C-MP789JR-X001-d
- Assert.assertEquals("C-newPatient-X003-d02", newCmoLabel);
+ Assertions.assertEquals("C-newPatient-X003-d02", newCmoLabel);
Status sampleStatus = cmoLabelGeneratorService.generateSampleStatus(
updatedSample, existingSamples);
- Assert.assertEquals(Boolean.TRUE, sampleStatus.getValidationStatus());
- Assert.assertEquals(sampleStatus.getValidationReport(), (new HashMap()).toString());
+ Assertions.assertEquals(Boolean.TRUE, sampleStatus.getValidationStatus());
+ Assertions.assertEquals(sampleStatus.getValidationReport(), (new HashMap()).toString());
}
/**
@@ -180,13 +177,13 @@ public void testCmoLabelGenForExistingSampleWithPatientCorrection()
updatedSample, existingSamples);
// if the cmo label before the update is C-MP789JR-X001-d
- Assert.assertEquals("C-newPatient-X001-d02", newCmoLabel);
+ Assertions.assertEquals("C-newPatient-X001-d02", newCmoLabel);
Status sampleStatus = cmoLabelGeneratorService.generateSampleStatus(
updatedSample, existingSamples);
- Assert.assertEquals(Boolean.TRUE, sampleStatus.getValidationStatus());
- Assert.assertEquals(sampleStatus.getValidationReport(), (new HashMap()).toString());
+ Assertions.assertEquals(Boolean.TRUE, sampleStatus.getValidationStatus());
+ Assertions.assertEquals(sampleStatus.getValidationReport(), (new HashMap()).toString());
}
/**
@@ -226,12 +223,12 @@ public void testCmoLabelGenForSampleWithOtherSpecimenType()
// should return null string
String newCmoLabel = cmoLabelGeneratorService.generateCmoSampleLabel(
updatedSample, existingSamples);
- Assert.assertEquals("C-MP789JR-F001-d01", newCmoLabel);
+ Assertions.assertEquals("C-MP789JR-F001-d01", newCmoLabel);
Status sampleStatus = cmoLabelGeneratorService.generateSampleStatus(
updatedSample, existingSamples);
- Assert.assertEquals(Boolean.FALSE, sampleStatus.getValidationStatus());
- Assert.assertNotSame(sampleStatus.getValidationReport(), (new HashMap()).toString());
+ Assertions.assertEquals(Boolean.FALSE, sampleStatus.getValidationStatus());
+ Assertions.assertNotSame(sampleStatus.getValidationReport(), (new HashMap()).toString());
}
@Test
@@ -245,7 +242,7 @@ public void testCmoCelllineLabelGenerationUpdates() {
String sampleLabel = cmoLabelGeneratorService.generateCmoSampleLabel(requestId,
sample, existingSamples);
String sampleExpectedLabel = "AMP1-86793T";
- Assert.assertEquals("AMP1-86793T", sampleLabel);
+ Assertions.assertEquals("AMP1-86793T", sampleLabel);
// test label generated with new investigator id and assert
// that the sample would require a label update
@@ -254,9 +251,9 @@ public void testCmoCelllineLabelGenerationUpdates() {
String sampleUpdatedInvestigatorIdLabel = cmoLabelGeneratorService.generateCmoSampleLabel(requestId,
sampleUpdatedInvestigatorId, existingSamples);
String expectedLabelWithInvestiagorIdUpdate = "MIP2-86793T";
- Assert.assertEquals(expectedLabelWithInvestiagorIdUpdate, sampleUpdatedInvestigatorIdLabel);
+ Assertions.assertEquals(expectedLabelWithInvestiagorIdUpdate, sampleUpdatedInvestigatorIdLabel);
// assert that the sample would require a label update
- Assert.assertTrue(cmoLabelGeneratorService.igoSampleRequiresLabelUpdate(
+ Assertions.assertTrue(cmoLabelGeneratorService.igoSampleRequiresLabelUpdate(
sampleUpdatedInvestigatorIdLabel, sampleLabel));
// test label generated with same investigator id as original sample
@@ -265,8 +262,8 @@ public void testCmoCelllineLabelGenerationUpdates() {
SpecimenType.CELLLINE, NucleicAcid.CFDNA, "AMP1");
String sampleUpdatedNaExtractLabel = cmoLabelGeneratorService.generateCmoSampleLabel(requestId,
sampleUpdatedNaExtract, existingSamples);
- Assert.assertEquals(sampleExpectedLabel, sampleUpdatedNaExtractLabel);
- Assert.assertFalse(cmoLabelGeneratorService.igoSampleRequiresLabelUpdate(
+ Assertions.assertEquals(sampleExpectedLabel, sampleUpdatedNaExtractLabel);
+ Assertions.assertFalse(cmoLabelGeneratorService.igoSampleRequiresLabelUpdate(
sampleUpdatedNaExtractLabel, sampleExpectedLabel));
}
@@ -274,7 +271,7 @@ public void testCmoCelllineLabelGenerationUpdates() {
public void testDefaultSampleTypeAbbreviation() {
String sampleTypeAbbrev = cmoLabelGeneratorService.resolveSampleTypeAbbreviation("RapidAutopsy",
"Cerebrospinal Fluid", "Other");
- Assert.assertTrue(sampleTypeAbbrev.equals("F"));
+ Assertions.assertTrue(sampleTypeAbbrev.equals("F"));
}
private IgoSampleManifest getSampleMetadata(String igoId, String cmoPatientId,
diff --git a/src/test/java/org/mskcc/smile/LabelGeneratorTestApp.java b/src/test/java/org/mskcc/smile/LabelGeneratorTestApp.java
new file mode 100644
index 0000000..a322717
--- /dev/null
+++ b/src/test/java/org/mskcc/smile/LabelGeneratorTestApp.java
@@ -0,0 +1,23 @@
+package org.mskcc.smile;
+
+import org.mskcc.cmo.messaging.Gateway;
+import org.mskcc.smile.service.impl.LabelGenMessageHandlingServiceImpl;
+import org.mskcc.smile.service.impl.RequestReplyHandlingServiceImpl;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+/**
+ *
+ * @author laptop
+ */
+@SpringBootApplication(scanBasePackages = {"org.mskcc.smile.service", "org.mskcc.smile.commons.*"})
+public class LabelGeneratorTestApp {
+ @MockBean
+ public Gateway messagingGateway;
+
+ @MockBean
+ public LabelGenMessageHandlingServiceImpl labelGenMessageHandlingServiceImpl;
+
+ @MockBean
+ public RequestReplyHandlingServiceImpl requestReplyMessageHandlingServiceImpl;
+}
diff --git a/src/test/java/org/mskcc/smile/PortedLimsRestCmoLabelGenerationTest.java b/src/test/java/org/mskcc/smile/PortedLimsRestCmoLabelGenerationTest.java
index 96ba5b4..a4913d0 100644
--- a/src/test/java/org/mskcc/smile/PortedLimsRestCmoLabelGenerationTest.java
+++ b/src/test/java/org/mskcc/smile/PortedLimsRestCmoLabelGenerationTest.java
@@ -5,9 +5,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import junit.framework.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
import org.mskcc.smile.commons.enums.NucleicAcid;
import org.mskcc.smile.commons.enums.SpecimenType;
import org.mskcc.smile.config.TestConfiguration;
@@ -15,8 +14,8 @@
import org.mskcc.smile.model.igo.IgoSampleManifest;
import org.mskcc.smile.service.CmoLabelGeneratorService;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Import;
/**
* Ported tests from SampleTypeCorrectedCmoSampleViewGeneratorTest.java
@@ -31,8 +30,8 @@
* - Each sample has its corresponding request id assigned to it.
* @author ochoaa
*/
-@ContextConfiguration(classes = TestConfiguration.class)
-@RunWith(SpringJUnit4ClassRunner.class)
+@SpringBootTest(classes = LabelGeneratorTestApp.class)
+@Import(TestConfiguration.class)
public class PortedLimsRestCmoLabelGenerationTest {
@Autowired
@@ -56,7 +55,7 @@ public void testPatientNoExistingSamples() throws Exception {
SpecimenType.XENOGRAFT, NucleicAcid.DNA);
String cmoId = cmoLabelGeneratorService.generateCmoSampleLabel(requestId, sample, new ArrayList<>());
- Assert.assertEquals("C-1235-X001-d01", cmoId);
+ Assertions.assertEquals("C-1235-X001-d01", cmoId);
}
/**
@@ -82,7 +81,7 @@ public void testPatientOneExistingSample() throws Exception {
List existingSamples = Arrays.asList(existingSample);
String cmoId = cmoLabelGeneratorService.generateCmoSampleLabel(requestId, sample, existingSamples);
- Assert.assertEquals("C-1235-X002-d02", cmoId);
+ Assertions.assertEquals("C-1235-X002-d02", cmoId);
}
/**
@@ -110,7 +109,7 @@ public void testPatientOneExistingSampleNucAcidCounter() throws Exception {
List existingSamples = Arrays.asList(existingSample);
String cmoId = cmoLabelGeneratorService.generateCmoSampleLabel(requestId, sample, existingSamples);
- Assert.assertEquals("C-1235-X002-d02", cmoId);
+ Assertions.assertEquals("C-1235-X002-d02", cmoId);
}
/**
@@ -135,7 +134,7 @@ public void testPatientOneSampleNextIncrement() throws Exception {
List existingSamples = Arrays.asList(existingSample);
String cmoId = cmoLabelGeneratorService.generateCmoSampleLabel(requestId, sample, existingSamples);
- Assert.assertEquals("C-1235-X013-d02", cmoId);
+ Assertions.assertEquals("C-1235-X013-d02", cmoId);
}
/**
@@ -164,7 +163,7 @@ public void testPatientOneSampleDiffRequest() throws Exception {
// since nucleic acid abbreviation is different from existing sample, the
// nucleic acid counter is also '01'
String cmoId = cmoLabelGeneratorService.generateCmoSampleLabel(requestId, sample, existingSamples);
- Assert.assertEquals("C-1235-X002-r01", cmoId);
+ Assertions.assertEquals("C-1235-X002-r01", cmoId);
}
/**
@@ -185,7 +184,7 @@ public void testPatientTwoSamplesSameSpecimenTypeNucleicAcid() throws Exception
SpecimenType.XENOGRAFT, NucleicAcid.DNA);
String cmoId1 = cmoLabelGeneratorService.generateCmoSampleLabel(requestId,
sample1, new ArrayList<>());
- Assert.assertEquals("C-1235-X001-d01", cmoId1);
+ Assertions.assertEquals("C-1235-X001-d01", cmoId1);
// now we have one existing sample in this request for the same patient
SampleMetadata existingSample = getSampleMetadataWithCmoLabel("4324_1",
@@ -196,7 +195,7 @@ public void testPatientTwoSamplesSameSpecimenTypeNucleicAcid() throws Exception
IgoSampleManifest sample2 = getSampleMetadata("4324_2", cmoPatientId,
SpecimenType.XENOGRAFT, NucleicAcid.DNA);
String cmoId2 = cmoLabelGeneratorService.generateCmoSampleLabel(requestId, sample2, existingSamples);
- Assert.assertEquals("C-1235-X002-d02", cmoId2);
+ Assertions.assertEquals("C-1235-X002-d02", cmoId2);
}
/**
@@ -217,7 +216,7 @@ public void testPatientTwoSamplesSameSpecimenTypeDiffNucleicAcid() throws Except
SpecimenType.XENOGRAFT, NucleicAcid.DNA);
String cmoId1 = cmoLabelGeneratorService.generateCmoSampleLabel(requestId,
sample1, new ArrayList<>());
- Assert.assertEquals("C-1235-X001-d01", cmoId1);
+ Assertions.assertEquals("C-1235-X001-d01", cmoId1);
// now we have one existing sample in this request for the same patient
SampleMetadata existingSample = getSampleMetadataWithCmoLabel("4324_1",
@@ -228,7 +227,7 @@ public void testPatientTwoSamplesSameSpecimenTypeDiffNucleicAcid() throws Except
IgoSampleManifest sample2 = getSampleMetadata("4324_2", cmoPatientId,
SpecimenType.XENOGRAFT, NucleicAcid.RNA);
String cmoId2 = cmoLabelGeneratorService.generateCmoSampleLabel(requestId, sample2, existingSamples);
- Assert.assertEquals("C-1235-X002-r01", cmoId2);
+ Assertions.assertEquals("C-1235-X002-r01", cmoId2);
}
/**
@@ -250,7 +249,7 @@ public void testPatientTwoSamplesDiffSpecimenTypeSameRequestNucleicAcid()
SpecimenType.XENOGRAFT, NucleicAcid.DNA);
String cmoId1 = cmoLabelGeneratorService.generateCmoSampleLabel(requestId,
sample1, new ArrayList<>());
- Assert.assertEquals("C-1235-X001-d01", cmoId1);
+ Assertions.assertEquals("C-1235-X001-d01", cmoId1);
// now we have one existing sample in this request for the same patient
SampleMetadata existingSample = getSampleMetadataWithCmoLabel("4324_1",
@@ -262,7 +261,7 @@ public void testPatientTwoSamplesDiffSpecimenTypeSameRequestNucleicAcid()
SpecimenType.PDX, NucleicAcid.DNA);
String cmoId2 = cmoLabelGeneratorService.generateCmoSampleLabel(requestId,
sample2, existingSamples);
- Assert.assertEquals("C-1235-X002-d02", cmoId2);
+ Assertions.assertEquals("C-1235-X002-d02", cmoId2);
}
/**
@@ -283,7 +282,7 @@ public void testPatientTwoSamplesDiffRequestSameeSpecimenTypeNucleicAcid() throw
SpecimenType.ORGANOID, NucleicAcid.DNA);
String cmoId1 = cmoLabelGeneratorService.generateCmoSampleLabel(requestId,
sample1, new ArrayList<>());
- Assert.assertEquals("C-1235-G001-d01", cmoId1);
+ Assertions.assertEquals("C-1235-G001-d01", cmoId1);
// now we have one existing sample in this request for the same patient
SampleMetadata existingSample = getSampleMetadataWithCmoLabel("4324_1",
@@ -295,7 +294,7 @@ public void testPatientTwoSamplesDiffRequestSameeSpecimenTypeNucleicAcid() throw
SpecimenType.ORGANOID, NucleicAcid.DNA);
String cmoId2 = cmoLabelGeneratorService.generateCmoSampleLabel(requestId,
sample2, existingSamples);
- Assert.assertEquals("C-1235-G002-d02", cmoId2);
+ Assertions.assertEquals("C-1235-G002-d02", cmoId2);
}
/**
@@ -332,10 +331,10 @@ public void testIgoSampleWithNoLabelChangingMetadataUpdates() throws Exception {
updatedSample, existingSamples);
// confirm that the label generated would still increment even though it will
// be determined that the sample cmo label does NOT need to be updated for this sample
- Assert.assertEquals("C-1235-G001-d03", updatedCmoLabel);
+ Assertions.assertEquals("C-1235-G001-d03", updatedCmoLabel);
Boolean needsUpdates =
cmoLabelGeneratorService.igoSampleRequiresLabelUpdate(updatedCmoLabel, cmoId1);
- Assert.assertFalse(needsUpdates);
+ Assertions.assertFalse(needsUpdates);
}
/**
@@ -367,9 +366,9 @@ public void testIgoSampleWithLabelChangingMetadataUpdates() throws Exception {
SpecimenType.ORGANOID, NucleicAcid.RNA);
String updatedCmoLabel = cmoLabelGeneratorService.generateCmoSampleLabel(requestId,
updatedSample, existingSamples);
- Assert.assertEquals("C-1235-G001-r01", updatedCmoLabel);
+ Assertions.assertEquals("C-1235-G001-r01", updatedCmoLabel);
Boolean needsUpdates = cmoLabelGeneratorService.igoSampleRequiresLabelUpdate(updatedCmoLabel, cmoId1);
- Assert.assertTrue(needsUpdates);
+ Assertions.assertTrue(needsUpdates);
}
/**
@@ -379,7 +378,7 @@ public void testIgoSampleWithLabelChangingMetadataUpdates() throws Exception {
@Test
public void testRequiresUpdateWhenExistingLabelIsEmpty() throws Exception {
Boolean needsUpdates1 = cmoLabelGeneratorService.igoSampleRequiresLabelUpdate("C-1235-G001-d01", "");
- Assert.assertTrue(needsUpdates1);
+ Assertions.assertTrue(needsUpdates1);
}
private SampleMetadata getSampleMetadataWithCmoLabel(String igoId, String cmoPatientId,