@Test public void testPopulate() { when(tagFactory.create("token")).thenReturn(token); when(tagFactory.create("case-sensitive")).thenReturn(caseSensitive); when(dataService.getRepository(TagMetadata.TAG, Tag.class)).thenReturn(tagRepository); tagPopulator.populate(); verify(tagRepository).upsertBatch(List.of(token, caseSensitive)); verify(token).setRelationIri(RDF.TYPE.toString()); verify(token).setObjectIri(XMLSchema.TOKEN.toString()); verify(caseSensitive).setRelationIri(RDF.TYPE.toString()); verify(caseSensitive).setObjectIri(Vocabulary.CASE_SENSITIVE.toString()); }
public void populate() { Tag isAToken = tagFactory.create("token"); isAToken.setLabel("Token"); isAToken.setObjectIri(TOKEN.toString()); isAToken.setRelationIri(type.getIRI()); isAToken.setRelationLabel(type.getLabel()); Tag isCaseSensitive = tagFactory.create("case-sensitive"); isCaseSensitive.setLabel("Case Sensitive"); isCaseSensitive.setObjectIri(CASE_SENSITIVE.toString()); isCaseSensitive.setRelationIri(type.getIRI()); isCaseSensitive.setRelationLabel(type.getLabel()); dataService.getRepository(TAG, Tag.class).upsertBatch(List.of(isAToken, isCaseSensitive)); }
TagPopulator { public void populate() { Tag isAToken = tagFactory.create("token"); isAToken.setLabel("Token"); isAToken.setObjectIri(TOKEN.toString()); isAToken.setRelationIri(type.getIRI()); isAToken.setRelationLabel(type.getLabel()); Tag isCaseSensitive = tagFactory.create("case-sensitive"); isCaseSensitive.setLabel("Case Sensitive"); isCaseSensitive.setObjectIri(CASE_SENSITIVE.toString()); isCaseSensitive.setRelationIri(type.getIRI()); isCaseSensitive.setRelationLabel(type.getLabel()); dataService.getRepository(TAG, Tag.class).upsertBatch(List.of(isAToken, isCaseSensitive)); } }
TagPopulator { public void populate() { Tag isAToken = tagFactory.create("token"); isAToken.setLabel("Token"); isAToken.setObjectIri(TOKEN.toString()); isAToken.setRelationIri(type.getIRI()); isAToken.setRelationLabel(type.getLabel()); Tag isCaseSensitive = tagFactory.create("case-sensitive"); isCaseSensitive.setLabel("Case Sensitive"); isCaseSensitive.setObjectIri(CASE_SENSITIVE.toString()); isCaseSensitive.setRelationIri(type.getIRI()); isCaseSensitive.setRelationLabel(type.getLabel()); dataService.getRepository(TAG, Tag.class).upsertBatch(List.of(isAToken, isCaseSensitive)); } TagPopulator(TagFactory tagFactory, DataService dataService); }
TagPopulator { public void populate() { Tag isAToken = tagFactory.create("token"); isAToken.setLabel("Token"); isAToken.setObjectIri(TOKEN.toString()); isAToken.setRelationIri(type.getIRI()); isAToken.setRelationLabel(type.getLabel()); Tag isCaseSensitive = tagFactory.create("case-sensitive"); isCaseSensitive.setLabel("Case Sensitive"); isCaseSensitive.setObjectIri(CASE_SENSITIVE.toString()); isCaseSensitive.setRelationIri(type.getIRI()); isCaseSensitive.setRelationLabel(type.getLabel()); dataService.getRepository(TAG, Tag.class).upsertBatch(List.of(isAToken, isCaseSensitive)); } TagPopulator(TagFactory tagFactory, DataService dataService); void populate(); }
TagPopulator { public void populate() { Tag isAToken = tagFactory.create("token"); isAToken.setLabel("Token"); isAToken.setObjectIri(TOKEN.toString()); isAToken.setRelationIri(type.getIRI()); isAToken.setRelationLabel(type.getLabel()); Tag isCaseSensitive = tagFactory.create("case-sensitive"); isCaseSensitive.setLabel("Case Sensitive"); isCaseSensitive.setObjectIri(CASE_SENSITIVE.toString()); isCaseSensitive.setRelationIri(type.getIRI()); isCaseSensitive.setRelationLabel(type.getLabel()); dataService.getRepository(TAG, Tag.class).upsertBatch(List.of(isAToken, isCaseSensitive)); } TagPopulator(TagFactory tagFactory, DataService dataService); void populate();  }