TIL that anyString() wont match nulls in Mockito, but any() will
This commit is contained in:
parent
ac31c4e7a1
commit
77c99e47c1
|
@ -779,7 +779,5 @@ public class FhirResourceDaoR4VersionedReferenceTest extends BaseJpaR4Test {
|
||||||
assertEquals(observationId.getValue(), resources.get(0).getIdElement().getValue());
|
assertEquals(observationId.getValue(), resources.get(0).getIdElement().getValue());
|
||||||
assertEquals(patientId.withVersion("2").getValue(), resources.get(1).getIdElement().getValue());
|
assertEquals(patientId.withVersion("2").getValue(), resources.get(1).getIdElement().getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -428,13 +428,13 @@ public class FhirInstanceValidatorR5Test {
|
||||||
String input = IOUtils.toString(FhirInstanceValidator.class.getResourceAsStream("/vitals.json"), Charsets.UTF_8);
|
String input = IOUtils.toString(FhirInstanceValidator.class.getResourceAsStream("/vitals.json"), Charsets.UTF_8);
|
||||||
|
|
||||||
IResourceValidator.IValidatorResourceFetcher resourceFetcher = mock(IResourceValidator.IValidatorResourceFetcher.class);
|
IResourceValidator.IValidatorResourceFetcher resourceFetcher = mock(IResourceValidator.IValidatorResourceFetcher.class);
|
||||||
when(resourceFetcher.validationPolicy(any(), anyString(), anyString(), anyString())).thenReturn(IResourceValidator.ReferenceValidationPolicy.CHECK_TYPE_IF_EXISTS);
|
when(resourceFetcher.validationPolicy(any(), any(), any(), any())).thenReturn(IResourceValidator.ReferenceValidationPolicy.CHECK_TYPE_IF_EXISTS);
|
||||||
myInstanceVal.setValidatorResourceFetcher(resourceFetcher);
|
myInstanceVal.setValidatorResourceFetcher(resourceFetcher);
|
||||||
myVal.validateWithResult(input);
|
myVal.validateWithResult(input);
|
||||||
|
|
||||||
verify(resourceFetcher, times(13)).resolveURL(any(), anyString(), anyString(), anyString(), anyString());
|
verify(resourceFetcher, times(13)).resolveURL(any(), any(), anyString(), anyString(), anyString());
|
||||||
verify(resourceFetcher, times(4)).validationPolicy(any(), anyString(), anyString(), anyString());
|
verify(resourceFetcher, times(4)).validationPolicy(any(), any(), anyString(), anyString());
|
||||||
verify(resourceFetcher, times(3)).fetch(any(), anyString(), anyString());
|
verify(resourceFetcher, times(3)).fetch(any(), any(), anyString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue