Search in sources :

Example 1 with DistributionClientDownloadResultImpl

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());
}
Also used : IDistributionClientDownloadResult(org.onap.sdc.api.results.IDistributionClientDownloadResult) DistributionClientDownloadResultImpl(org.onap.sdc.impl.DistributionClientDownloadResultImpl) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 IDistributionClientDownloadResult (org.onap.sdc.api.results.IDistributionClientDownloadResult)1 DistributionClientDownloadResultImpl (org.onap.sdc.impl.DistributionClientDownloadResultImpl)1