### Question:
CommonCodeSystemsTerminologyService implements IValidationSupport { @Override public LookupCodeResult lookupCode(ValidationSupportContext theValidationSupportContext, String theSystem, String theCode) { Map<String, String> map; switch (theSystem) { case UCUM_CODESYSTEM_URL: return lookupUcumCode(theCode); case MIMETYPES_CODESYSTEM_URL: return lookupMimetypeCode(theCode); case COUNTRIES_CODESYSTEM_URL: map = ISO_3166_CODES; break; case CURRENCIES_CODESYSTEM_URL: map = ISO_4217_CODES; break; case USPS_CODESYSTEM_URL: map = USPS_CODES; break; default: return null; } String display = map.get(theCode); if (isNotBlank(display)) { LookupCodeResult retVal = new LookupCodeResult(); retVal.setSearchedForCode(theCode); retVal.setSearchedForSystem(theSystem); retVal.setFound(true); retVal.setCodeDisplay(display); return retVal; } LookupCodeResult retVal = new LookupCodeResult(); retVal.setSearchedForCode(theCode); retVal.setSearchedForSystem(theSystem); retVal.setFound(false); return retVal; } CommonCodeSystemsTerminologyService(FhirContext theFhirContext); @Override CodeValidationResult validateCodeInValueSet(ValidationSupportContext theValidationSupportContext, ConceptValidationOptions theOptions, String theCodeSystem, String theCode, String theDisplay, @Nonnull IBaseResource theValueSet); @Override CodeValidationResult validateCode(ValidationSupportContext theValidationSupportContext, ConceptValidationOptions theOptions, String theCodeSystem, String theCode, String theDisplay, String theValueSetUrl); @Nullable CodeValidationResult validateLookupCode(ValidationSupportContext theValidationSupportContext, String theCode, String theSystem); @Override LookupCodeResult lookupCode(ValidationSupportContext theValidationSupportContext, String theSystem, String theCode); @Override IBaseResource fetchCodeSystem(String theSystem); @Override boolean isCodeSystemSupported(ValidationSupportContext theValidationSupportContext, String theSystem); @Override boolean isValueSetSupported(ValidationSupportContext theValidationSupportContext, String theValueSetUrl); @Override FhirContext getFhirContext(); static String getValueSetUrl(@Nonnull IBaseResource theValueSet); static String getCodeSystemUrl(@Nonnull IBaseResource theCodeSystem); static String getValueSetVersion(@Nonnull IBaseResource theValueSet); static final String LANGUAGES_VALUESET_URL; static final String MIMETYPES_VALUESET_URL; static final String MIMETYPES_CODESYSTEM_URL; static final String CURRENCIES_CODESYSTEM_URL; static final String CURRENCIES_VALUESET_URL; static final String COUNTRIES_CODESYSTEM_URL; static final String UCUM_CODESYSTEM_URL; static final String UCUM_VALUESET_URL; }### Answer:
@Test public void testUcum_LookupCode_Good() { IValidationSupport.LookupCodeResult outcome = mySvc.lookupCode(new ValidationSupportContext(myCtx.getValidationSupport()), "http: assertEquals(true, outcome.isFound()); }
@Test public void testUcum_LookupCode_Good2() { IValidationSupport.LookupCodeResult outcome = mySvc.lookupCode(new ValidationSupportContext(myCtx.getValidationSupport()), "http: assertEquals(true, outcome.isFound()); }
@Test public void testUcum_LookupCode_Bad() { IValidationSupport.LookupCodeResult outcome = mySvc.lookupCode(new ValidationSupportContext(myCtx.getValidationSupport()), "http: assertEquals(false, outcome.isFound()); }
@Test public void testUcum_LookupCode_UnknownSystem() { IValidationSupport.LookupCodeResult outcome = mySvc.lookupCode(new ValidationSupportContext(myCtx.getValidationSupport()), "http: assertNull(outcome); }