Restore and fix failing SimpleWorkerContextTests (#1557)

* Restore and fix failing tests

* Bump test cases version

* Use released test cases
This commit is contained in:
dotasek 2024-02-01 09:25:20 -05:00 committed by GitHub
parent 3a1946e37d
commit af43ce9fbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 29 additions and 32 deletions

View File

@ -325,7 +325,7 @@ public class SimpleWorkerContextTests {
ValueSetExpansionOutcome actualExpansionResult = context.expandVS(inc, true, false);
// assertEquals(expectedValueSet, actualExpansionResult.getValueset());
assertEquals(expectedValueSet, actualExpansionResult.getValueset());
Mockito.verify(terminologyCache).getExpansion(cacheToken);
Mockito.verify(terminologyCache).cacheExpansion(cacheToken, actualExpansionResult,true);
@ -412,7 +412,7 @@ public class SimpleWorkerContextTests {
ValueSetExpansionOutcome actualExpansionResult = context.expandVS(vs, true, true, true, pIn, false);
// assertEquals(expectedValueSet, actualExpansionResult.getValueset());
assertEquals(expectedValueSet, actualExpansionResult.getValueset());
Mockito.verify(terminologyCache).getExpansion(cacheToken);
Mockito.verify(terminologyCache).cacheExpansion(cacheToken, actualExpansionResult, true);
@ -421,40 +421,37 @@ public class SimpleWorkerContextTests {
@Test
public void testInitializationWithCache() {
// String address = "/...";
//
// Mockito.doReturn(true).when(terminologyCache).hasTerminologyCapabilities(address);
//// Mockito.doReturn(true).when(terminologyCache).hasCapabilityStatement();
//
// Mockito.doReturn(terminologyCapabilities).when(terminologyCache).getTerminologyCapabilities(address);
//// Mockito.doReturn(capabilitiesStatement).when(terminologyCache).getCapabilityStatement();
//
// context.connectToTSServer(new TerminologyClientR5Factory(), terminologyClient);
//
// Mockito.verify(terminologyCache).getTerminologyCapabilities(address);
// Mockito.verify(terminologyClient).getCapabilitiesStatementQuick();
//
// Mockito.verify(terminologyCache, times(0)).getCapabilityStatement(address);
// Mockito.verify(terminologyClient, times(0)).getTerminologyCapabilities();
String address = "dummyUrl";
Mockito.doReturn(true).when(terminologyCache).hasTerminologyCapabilities(address);
Mockito.doReturn(terminologyCapabilities).when(terminologyCache).getTerminologyCapabilities(address);
context.connectToTSServer(new TerminologyClientR5Factory(), terminologyClient);
Mockito.verify(terminologyCache).getTerminologyCapabilities(address);
Mockito.verify(terminologyClient).getCapabilitiesStatementQuick();
Mockito.verify(terminologyCache, times(0)).getCapabilityStatement(address);
Mockito.verify(terminologyClient, times(0)).getTerminologyCapabilities();
}
@Test
public void testInitializationWithClient() {
// String address = "/...";
//
// Mockito.doReturn(false).when(terminologyCache).hasTerminologyCapabilities(address);
//// Mockito.doReturn(false).when(terminologyCache).hasCapabilityStatement();
//
// Mockito.doReturn(terminologyCapabilities).when(terminologyClient).getTerminologyCapabilities();
// Mockito.doReturn(capabilitiesStatement).when(terminologyClient).getCapabilitiesStatementQuick();
//
// context.connectToTSServer(new TerminologyClientR5Factory(), terminologyClient);
//
// Mockito.verify(terminologyCache, times(0)).getTerminologyCapabilities(address);
// Mockito.verify(terminologyCache, times(0)).getCapabilityStatement(address);
//
// Mockito.verify(terminologyClient).getTerminologyCapabilities();
// Mockito.verify(terminologyClient).getCapabilitiesStatementQuick();
String address = "dummyUrl";
Mockito.doReturn(false).when(terminologyCache).hasTerminologyCapabilities(address);
Mockito.doReturn(terminologyCapabilities).when(terminologyClient).getTerminologyCapabilities();
Mockito.doReturn(capabilitiesStatement).when(terminologyClient).getCapabilitiesStatementQuick();
context.connectToTSServer(new TerminologyClientR5Factory(), terminologyClient);
Mockito.verify(terminologyCache, times(0)).getTerminologyCapabilities(address);
Mockito.verify(terminologyCache, times(0)).getCapabilityStatement(address);
Mockito.verify(terminologyClient).getTerminologyCapabilities();
Mockito.verify(terminologyClient).getCapabilitiesStatementQuick();
}