use of org.onap.sdc.impl.DistributionClientDownloadResultImpl in project so by onap.
the class DistributionClientEmulatorTest method downloadSuccess.
@Test
public void downloadSuccess() throws IOException {
ArtifactInfoImpl info = new ArtifactInfoImpl();
info.setArtifactURL("mso.json");
info.setArtifactName("testArtifactName");
distClientEmulator.setResourcePath("src/test/resources/");
IDistributionClientDownloadResult result = distClientEmulator.download(info);
byte[] expectedInputStream = Files.readAllBytes(Paths.get(distClientEmulator.getResourcePath() + info.getArtifactURL()));
IDistributionClientDownloadResult expectedResult = new DistributionClientDownloadResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name(), info.getArtifactName(), expectedInputStream);
assertEquals(expectedResult.getDistributionActionResult(), result.getDistributionActionResult());
assertEquals(expectedResult.getDistributionMessageResult(), result.getDistributionMessageResult());
}
Aggregations