Skip to content

Commit

Permalink
resource api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-zinchenko committed Dec 26, 2024
1 parent 02cbbf8 commit 39a8067
Showing 1 changed file with 25 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ void testHeartbeat() {
}

@Test
void testApplicationWithTypeSchemaCreation_files_ok() {
void testApplicationWithTypeSchemaCreation_Ok_FilesAccessible() {
Response response = upload(HttpMethod.PUT,"/v1/files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/test_file1.txt",null, """
Test1
""");
Expand Down Expand Up @@ -357,15 +357,15 @@ void testApplicationWithTypeSchemaCreation_files_ok() {
}

@Test
void testApplicationWithTypeSchemaCreation_fail() {
void testApplicationWithTypeSchemaCreation_Ok_Folder() {
Response response = send(HttpMethod.PUT,"/v1/applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/test_app_folder",null, """
{
"displayName": "test_app",
"customAppSchemaId": "https://mydial.somewhere.com/custom_application_schemas/specific_application_type",
"property1": "test property1",
"property2": "test property2",
"property3": [
"files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/unexisting_folder/unexisting_file.txt"
"files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/xyz/"
],
"userRoles": [
"Admin"
Expand All @@ -375,19 +375,19 @@ void testApplicationWithTypeSchemaCreation_fail() {
"description": "My application description"
}
""");
Assertions.assertEquals(400, response.status());
Assertions.assertEquals(200, response.status());
}

@Test
void testApplicationWithTypeSchemaCreation_folder_ok() {
Response response = send(HttpMethod.PUT,"/v1/applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/test_app",null, """
void testApplicationWithTypeSchemaCreation_Failed_FailAccessFile() {
Response response = send(HttpMethod.PUT,"/v1/applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/test_app_files_failed",null, """
{
"displayName": "test_app",
"customAppSchemaId": "https://mydial.somewhere.com/custom_application_schemas/specific_application_type",
"property1": "test property1",
"property2": "test property2",
"property3": [
"files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/xyz/"
"files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/unexisting_folder/unexisting_file.txt"
],
"userRoles": [
"Admin"
Expand All @@ -397,6 +397,23 @@ void testApplicationWithTypeSchemaCreation_folder_ok() {
"description": "My application description"
}
""");
Assertions.assertEquals(200, response.status());
Assertions.assertEquals(400, response.status());
}

@Test
void testApplicationWithTypeSchemaCreation_Failed_FailMissingProps() {
Response response = send(HttpMethod.PUT,"/v1/applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/test_app_props_failed",null, """
{
"displayName": "test_app",
"customAppSchemaId": "https://mydial.somewhere.com/custom_application_schemas/specific_application_type",
"userRoles": [
"Admin"
],
"forwardAuthToken": true,
"iconUrl": "https://mydial.somewhere.com/app-icon.svg",
"description": "My application description"
}
""");
Assertions.assertEquals(400, response.status());
}
}

0 comments on commit 39a8067

Please sign in to comment.