use of com.b2international.snowowl.test.commons.snomed.TestBranchContext.Builder in project snow-owl by b2ihealthcare.
the class SnomedEclLabelerRequestTest method setup.
@Before
public void setup() {
final IParser parser = ECL_INJECTOR.getInstance(IParser.class);
final IResourceValidator resourceValidator = ECL_INJECTOR.getInstance(IResourceValidator.class);
final ISerializer serializer = ECL_INJECTOR.getInstance(ISerializer.class);
Builder contextBuilder = TestBranchContext.on(MAIN).with(EclParser.class, new DefaultEclParser(parser, resourceValidator)).with(EclSerializer.class, new DefaultEclSerializer(serializer)).with(Index.class, rawIndex()).with(RevisionIndex.class, index()).with(ObjectMapper.class, getMapper());
CodeSystemResource.configureCodeSystem(contextBuilder);
context = contextBuilder.build();
}
use of com.b2international.snowowl.test.commons.snomed.TestBranchContext.Builder in project snow-owl by b2ihealthcare.
the class SnomedDescriptionUtilsTest method setup.
@BeforeClass
public static void setup() {
Builder contextBuilder = TestBranchContext.on(Branch.MAIN_PATH).with(ClassLoader.class, SnomedDescriptionUtilsTest.class.getClassLoader()).with(ObjectMapper.class, JsonSupport.getDefaultObjectMapper()).with(TerminologyRegistry.class, TerminologyRegistry.INSTANCE);
CodeSystemResource.configureCodeSystem(contextBuilder);
context = contextBuilder.build();
gbPreferredDescription = createDescription("1", "first description", Map.of(Concepts.REFSET_LANGUAGE_TYPE_UK, Acceptability.PREFERRED, Concepts.REFSET_LANGUAGE_TYPE_US, Acceptability.ACCEPTABLE));
usPreferredDescription = createDescription("2", "second description", Map.of(Concepts.REFSET_LANGUAGE_TYPE_UK, Acceptability.ACCEPTABLE, Concepts.REFSET_LANGUAGE_TYPE_US, Acceptability.PREFERRED));
sgPreferredDescription = createDescription("3", "third description", Map.of(Concepts.REFSET_LANGUAGE_TYPE_SG, Acceptability.PREFERRED));
englishAdditionalDescription = createDescription("4", "fourth description", Map.of(Concepts.REFSET_LANGUAGE_TYPE_UK, Acceptability.ACCEPTABLE, Concepts.REFSET_LANGUAGE_TYPE_US, Acceptability.ACCEPTABLE));
sgAdditionalDescription = createDescription("5", "fifth description", Map.of(Concepts.REFSET_LANGUAGE_TYPE_SG, Acceptability.ACCEPTABLE));
descriptions = List.of(gbPreferredDescription, usPreferredDescription, englishAdditionalDescription, sgPreferredDescription, sgAdditionalDescription);
}
use of com.b2international.snowowl.test.commons.snomed.TestBranchContext.Builder in project snow-owl by b2ihealthcare.
the class BaseValidationTest method setup.
@Before
public final void setup() {
final ClassPathScanner scanner = new ClassPathScanner("com.b2international");
Builder context = TestBranchContext.on(MAIN).with(ClassLoader.class, getClass().getClassLoader()).with(ClassPathScanner.class, scanner).with(Index.class, rawIndex()).with(RevisionIndex.class, index()).with(ObjectMapper.class, getMapper()).with(ValidationRepository.class, new ValidationRepository(rawIndex())).with(ValidationThreadPool.class, new ValidationThreadPool(1, 1, 1)).with(ValidationIssueDetailExtensionProvider.class, new ValidationIssueDetailExtensionProvider(scanner)).with(TerminologyRegistry.class, TerminologyRegistry.INSTANCE).with(ResourceURIPathResolver.class, ResourceURIPathResolver.fromMap(getTestCodeSystemPathMap())).with(ScriptEngine.Registry.class, new ScriptEngine.Registry(scanner));
configureContext(context);
this.context = context.build();
initializeData();
}
Aggregations