Skip to content

Commit

Permalink
Changes for review comments to use IOUtils for cheking the inputstrea…
Browse files Browse the repository at this point in the history
…m data

Signed-off-by: Chaithra Kandur Bhagavanthaiah <[email protected]>
  • Loading branch information
KBChaithra committed Sep 19, 2023
1 parent bf03b58 commit 393d5be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions basyx.aasxfileserver/basyx.aasxfileserver-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@
<groupId>org.eclipse.digitaltwin.aas4j</groupId>
<artifactId>model</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import org.apache.commons.io.IOUtils;
import org.eclipse.digitaltwin.basyx.aasxfileserver.AasxFileServer;
import org.eclipse.digitaltwin.basyx.aasxfileserver.PackageDescription;
import org.eclipse.digitaltwin.basyx.core.exceptions.ElementDoesNotExistException;
Expand Down Expand Up @@ -97,13 +99,14 @@ public void updateNonExistingAASXByPackageId() {
}

@Test
public void getAASXByPackageId() throws ElementDoesNotExistException {
public void getAASXByPackageId() throws ElementDoesNotExistException, IOException {

AasxFileServer server = getAasxFileServer();
PackageDescription packageDescription = DummyAasxFileServerFactory.createFirstDummyAASXPackage(server);
InputStream actualValue = server.getAASXByPackageId(packageDescription.getPackageId());
InputStream actualValue = server.getAASXByPackageId(packageDescription.getPackageId());
InputStream expectedValue = AasxFileServerSuiteHelper.FIRST_FILE;

assertEquals(AasxFileServerSuiteHelper.FIRST_FILE, actualValue);
IOUtils.contentEquals(expectedValue, actualValue);
}

@Test
Expand Down

0 comments on commit 393d5be

Please sign in to comment.