use of org.talend.dataprep.info.ManifestInfo in project data-prep by Talend.
the class VersionServiceTest method shouldAggregateSameBuildId.
@Test
public void shouldAggregateSameBuildId() throws Exception {
// given
final ManifestInfoProvider provider1 = mock(ManifestInfoProvider.class);
final ManifestInfoProvider provider2 = mock(ManifestInfoProvider.class);
when(provider1.getManifestInfo()).thenReturn(new ManifestInfo("v1", "1234"));
when(provider2.getManifestInfo()).thenReturn(new ManifestInfo("v1", "1234"));
ReflectionTestUtils.setField(versionService, "manifestInfoProviders", asList(provider1, provider2));
// when
final Version version = versionService.version();
// then
assertEquals("v1", version.getVersionId());
assertEquals("1234-1234", version.getBuildId());
}
use of org.talend.dataprep.info.ManifestInfo in project data-prep by Talend.
the class VersionServiceTest method shouldAggregateBuildId.
@Test
public void shouldAggregateBuildId() throws Exception {
// given
final ManifestInfoProvider provider1 = mock(ManifestInfoProvider.class);
final ManifestInfoProvider provider2 = mock(ManifestInfoProvider.class);
when(provider1.getManifestInfo()).thenReturn(new ManifestInfo("v1", "1234"));
when(provider2.getManifestInfo()).thenReturn(new ManifestInfo("v1", "5678"));
ReflectionTestUtils.setField(versionService, "manifestInfoProviders", asList(provider1, provider2));
// when
final Version version = versionService.version();
// then
assertEquals("v1", version.getVersionId());
assertEquals("1234-5678", version.getBuildId());
}
use of org.talend.dataprep.info.ManifestInfo in project data-prep by Talend.
the class VersionServiceTest method shouldShouldSkipMissingVersionId.
@Test
public void shouldShouldSkipMissingVersionId() throws Exception {
// given
final ManifestInfoProvider provider1 = mock(ManifestInfoProvider.class);
final ManifestInfoProvider provider2 = mock(ManifestInfoProvider.class);
when(provider1.getManifestInfo()).thenReturn(new ManifestInfo("v1", "1234"));
when(provider2.getManifestInfo()).thenReturn(new ManifestInfo("N/A", "1234"));
ReflectionTestUtils.setField(versionService, "manifestInfoProviders", asList(provider1, provider2));
// when
final Version version = versionService.version();
// then
assertEquals("v1", version.getVersionId());
assertEquals("1234-1234", version.getBuildId());
}
use of org.talend.dataprep.info.ManifestInfo in project data-prep by Talend.
the class VersionServiceTest method shouldAggregateVersionId.
@Test
public void shouldAggregateVersionId() throws Exception {
// given
final ManifestInfoProvider provider1 = mock(ManifestInfoProvider.class);
final ManifestInfoProvider provider2 = mock(ManifestInfoProvider.class);
when(provider1.getManifestInfo()).thenReturn(new ManifestInfo("v1", "1234"));
when(provider2.getManifestInfo()).thenReturn(new ManifestInfo("v2", "1234"));
ReflectionTestUtils.setField(versionService, "manifestInfoProviders", asList(provider1, provider2));
// when
final Version version = versionService.version();
// then
assertEquals("v1-v2", version.getVersionId());
assertEquals("1234-1234", version.getBuildId());
}
Aggregations