// repo has 3 artifacts indexed (plus 3 "internal" fields)
assertThat("We have at least 3 Lucene documents in there for 3 artifacts!", context.getSize() >= 6);
// repo has only 1 archetype
assertThat("Catalog not exact!", catalog.getArchetypes(), hasSize(1));
// add one archetype
ArtifactInfo artifactInfo =
new ArtifactInfo(context.getRepositoryId(), "org.sonatype.nexus.plugins", "nexus-archetype-plugin", "1.0",
null);
artifactInfo.packaging = "maven-archetype";
ArtifactContext ac = new ArtifactContext(null, null, null, artifactInfo, artifactInfo.calculateGav());
nexusIndexer.addArtifactToIndex(ac, context);
// get catalog again
catalog = macPlugin.listArcherypesAsCatalog(request, context);
// repo has 4 artifacts indexed (plus 3 "internal" fields)
assertThat("We have at least 4 Lucene documents in there for 3 artifacts!", context.getSize() >= 7);