-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AAS thumbnail operations #142
Conversation
basyx.aasrepository/basyx.aasrepository-backend-inmemory/pom.xml
Outdated
Show resolved
Hide resolved
@@ -287,6 +298,80 @@ public void getPaginatedSubmodelReferencesPaginated() { | |||
.get()); | |||
} | |||
|
|||
@Test | |||
public void updateThumbnail() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not testing the updateThumbnail behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I test the setThumbnail behavior. THe shell did not has a thumbnail before, and after setThumbnail, the shell should have a thumbnail. Here I asset that the thumbnail exists.
...itory-core/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/AasRepositorySuite.java
Outdated
Show resolved
Hide resolved
return executePutRequest(client, putRequest); | ||
} | ||
|
||
private CloseableHttpResponse executePutRequest(CloseableHttpClient client, HttpPut putRequest) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this put request, a file must be uploaded. In the method of BaSyxHttpUtils#L140, you cannot upload file, only string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IN BaSyxHttpUtils verlegen
CloseableHttpResponse response = BaSyxHttpTestUtils.executeDeleteOnURL(getThumbnailAccessURL(dummyAasId)); | ||
assertEquals(HttpStatus.OK.value(), response.getCode()); | ||
|
||
response = BaSyxHttpTestUtils.executeGetOnURL(getThumbnailAccessURL(dummyAasId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate in another test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cannot be seperated since I at first create a thumbnail because the shell had no thumbnail before, then I delete it, after that I use to get thumbnail to validate that the thumbnail is deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clarified
...p/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/http/AasRepositoryHTTPSuite.java
Outdated
Show resolved
Hide resolved
...p/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/http/AasRepositoryHTTPSuite.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/eclipse/digitaltwin/basyx/core/exceptions/FileDoesNotExistException.java
Outdated
Show resolved
Hide resolved
aasRepo.setThumbnail(AAS2, THUMBNAIL_FILE_PATH_1, "", getInputStreamOfFileFromClasspath(THUMBNAIL_FILE_PATH_1)); | ||
aasRepo.deleteThumbnail(AAS2); | ||
|
||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you also use @test(expected = FileDoesNotExistException.class) here?
} | ||
|
||
@Test | ||
public void deleteNoneExistingThumbnail() throws FileNotFoundException, UnsupportedEncodingException, ClientProtocolException, IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo deleteNon*ExistingThumbnail
} | ||
|
||
@Test | ||
public void getFileFromNotExistElement() throws FileNotFoundException, UnsupportedEncodingException, ClientProtocolException, IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getFileFromNonExistingElement
pom.xml
Outdated
@@ -16,10 +16,10 @@ | |||
<module>basyx.common</module> | |||
<module>basyx.submodelservice</module> | |||
<module>basyx.submodelrepository</module> | |||
<module>basyx.submodelregistry</module> | |||
<!--<module>basyx.submodelregistry</module>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncomment
pom.xml
Outdated
<module>basyx.aasservice</module> | ||
<module>basyx.aasrepository</module> | ||
<module>basyx.aasregistry</module> | ||
<!--<module>basyx.aasregistry</module>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncomment
No description provided.