Skip to content

Commit 84a8d0c

Browse files
authored
DP: fixed DP unit test (#318)
* fixed DB unit test * clean up
1 parent eeab566 commit 84a8d0c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

data-processing-service/src/test/java/gov/cdc/dataprocessing/service/implementation/manager/ManagerServiceTest.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import org.mockito.MockitoAnnotations;
4747

4848
import java.util.ArrayList;
49-
import java.util.NoSuchElementException;
5049
import java.util.Optional;
5150
import java.util.concurrent.CompletableFuture;
5251

@@ -316,7 +315,7 @@ void initiatingInvestigationAndPublicHealthCase_Exception() {
316315

317316

318317

319-
assertThrows(NoSuchElementException.class, () -> managerService.initiatingInvestigationAndPublicHealthCase(publicHealthCaseFlowContainer));
318+
assertThrows(DataProcessingException.class, () -> managerService.initiatingInvestigationAndPublicHealthCase(publicHealthCaseFlowContainer));
320319

321320
verify(nbsInterfaceRepository, times(1)).findByNbsInterfaceUid(any());
322321

data-processing-service/src/test/java/gov/cdc/dataprocessing/service/implementation/observation/ObservationCodeServiceTest.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ void deriveTheConditionCodeList_Test_4() throws DataProcessingException {
204204
orderTest.setTheParticipationDtoCollection(patCol);
205205

206206
when(observationUtil.getUid(any(), any(), any(), any(),
207-
any(), any(), any())).thenThrow(new DataProcessingException("TEST"));
207+
any(), any(), any())).thenReturn(-1L);
208208

209209
OrganizationContainer orgConn =new OrganizationContainer();
210210
var enCol = new ArrayList<EntityIdDto>();
@@ -218,11 +218,10 @@ void deriveTheConditionCodeList_Test_4() throws DataProcessingException {
218218
when(organizationRepositoryUtil.loadObject(10L, null)).thenReturn(orgConn);
219219

220220

221-
DataProcessingException thrown = assertThrows(DataProcessingException.class, () -> {
222-
observationCodeService.deriveTheConditionCodeList(labResultProxyVO, orderTest);
223-
});
221+
var test = observationCodeService.deriveTheConditionCodeList(labResultProxyVO, orderTest);
222+
224223

225-
assertNotNull(thrown);
224+
assertNotNull(test);
226225
}
227226

228227

0 commit comments

Comments
 (0)