MavenSearchDocumentProducer extends DefaultSearchDocumentProducer { @Override protected boolean isPrerelease(final FluentComponent component) { String baseVersion = (String) component.attributes().child(Maven2Format.NAME).get(P_BASE_VERSION); if (baseVersion == null) { return false; } return baseVersion.endsWith(SNAPSHOT_VERSION_SUFFIX); } @Inject  MavenSearchDocumentProducer(final Set<SearchDocumentExtension> documentExtensions);   }
@Test public void isPrerelease_shouldBeFalse_when_baseVersionIsNull() { assertFalse(underTest.isPrerelease(component)); }
@Test public void isPrerelease_shouldBeFalse_when_baseVersion_IsNotSnapshot() { when(childAttributes.get(P_BASE_VERSION)).thenReturn(VERSION_NUMBER); assertFalse(underTest.isPrerelease(component)); }
@Test public void isPrerelease_shouldBeTrue_when_baseVersion_IsNotSnapshot() { when(childAttributes.get(P_BASE_VERSION)).thenReturn(VERSION_NUMBER + SNAPSHOT_VERSION_SUFFIX); assertTrue(underTest.isPrerelease(component)); }