3232 * Test that queries are on the right URL, with the right headers. Also check that the received
3333 * response is parsed correctly in the generated client.
3434 */
35- public class DeploymentUnitTest extends WireMockTestServer {
35+ class DeploymentUnitTest extends WireMockTestServer {
3636 @ Test
3737 void getDeployments () {
3838 wireMockServer .stubFor (
@@ -48,32 +48,43 @@ void getDeployments() {
4848 "count": 1,
4949 "resources": [
5050 {
51+ "id": "d889e3a61050c085",
52+ "deploymentUrl": "https://api.ai.intprod-eu12.eu-central-1.aws.ml.hana.ondemand.com/v2/inference/deployments/d889e3a61050c085",
5153 "configurationId": "7652a231-ba9b-4fcc-b473-2c355cb21b61",
5254 "configurationName": "gpt-4-32k",
53- "createdAt": "2024-04-17T15:19:53Z",
54- "deploymentUrl": "https://api.ai.intprod-eu12.eu-central-1.aws.ml.hana.ondemand.com/v2/inference/deployments/d19b998f347341aa",
55+ "executableId": null,
56+ "scenarioId": "foundation-models",
57+ "status": "RUNNING",
58+ "statusMessage": null,
59+ "targetStatus": "RUNNING",
60+ "lastOperation": "CREATE",
61+ "latestRunningConfigurationId": "7652a231-ba9b-4fcc-b473-2c355cb21b61",
62+ "ttl": null,
5563 "details": {
64+ "scaling": {
65+ "backendDetails": {},
66+ "backend_details": {}
67+ },
5668 "resources": {
69+ "backendDetails": {
70+ "model": {
71+ "name": "gpt-4-32k",
72+ "version": "latest"
73+ }
74+ },
5775 "backend_details": {
5876 "model": {
5977 "name": "gpt-4-32k",
6078 "version": "latest"
6179 }
6280 }
63- },
64- "scaling": {
65- "backend_details": {}
6681 }
6782 },
68- "id": "d19b998f347341aa",
69- "lastOperation": "CREATE",
70- "latestRunningConfigurationId": "7652a231-ba9b-4fcc-b473-2c355cb21b61",
71- "modifiedAt": "2024-05-07T13:05:45Z",
72- "scenarioId": "foundation-models",
73- "startTime": "2024-04-17T15:21:15Z",
74- "status": "RUNNING",
75- "submissionTime": "2024-04-17T15:20:11Z",
76- "targetStatus": "RUNNING"
83+ "createdAt": "2024-09-20T11:31:24Z",
84+ "modifiedAt": "2024-10-30T13:36:38Z",
85+ "submissionTime": "2024-09-20T11:31:38Z",
86+ "startTime": "2024-09-20T11:32:42Z",
87+ "completionTime": null
7788 }
7889 ]
7990 }
@@ -89,24 +100,22 @@ void getDeployments() {
89100
90101 assertThat (deployment .getConfigurationId ()).isEqualTo ("7652a231-ba9b-4fcc-b473-2c355cb21b61" );
91102 assertThat (deployment .getConfigurationName ()).isEqualTo ("gpt-4-32k" );
92- assertThat (deployment .getCreatedAt ()).isEqualTo ("2024-04-17T15:19:53Z " );
103+ assertThat (deployment .getCreatedAt ()).isEqualTo ("2024-09-20T11:31:24Z " );
93104 assertThat (deployment .getDeploymentUrl ())
94105 .isEqualTo (
95- "https://api.ai.intprod-eu12.eu-central-1.aws.ml.hana.ondemand.com/v2/inference/deployments/d19b998f347341aa " );
106+ "https://api.ai.intprod-eu12.eu-central-1.aws.ml.hana.ondemand.com/v2/inference/deployments/d889e3a61050c085 " );
96107 // Response contains key "backend_details" while spec (mistakenly) defines key "backendDetails".
97108 val expected = Map .of ("model" , Map .of ("name" , "gpt-4-32k" , "version" , "latest" ));
98- assertThat (deployment .getDetails ().getResources ().getCustomField ("backend_details" ))
99- .isEqualTo (expected );
100- assertThat (deployment .getDetails ().getScaling ().getCustomFieldNames ())
101- .contains ("backend_details" );
102- assertThat (deployment .getId ()).isEqualTo ("d19b998f347341aa" );
109+ assertThat (deployment .getDetails ().getResources ().getBackendDetails ()).isEqualTo (expected );
110+ assertThat (deployment .getDetails ().getScaling ().getBackendDetails ()).isEqualTo (Map .of ());
111+ assertThat (deployment .getId ()).isEqualTo ("d889e3a61050c085" );
103112 assertThat (deployment .getLastOperation ()).isEqualTo (AiDeployment .LastOperationEnum .CREATE );
104113 assertThat (deployment .getLatestRunningConfigurationId ())
105114 .isEqualTo ("7652a231-ba9b-4fcc-b473-2c355cb21b61" );
106- assertThat (deployment .getModifiedAt ()).isEqualTo ("2024-05-07T13:05:45Z " );
107- assertThat (deployment .getStartTime ()).isEqualTo ("2024-04-17T15:21:15Z " );
115+ assertThat (deployment .getModifiedAt ()).isEqualTo ("2024-10-30T13:36:38Z " );
116+ assertThat (deployment .getStartTime ()).isEqualTo ("2024-09-20T11:32:42Z " );
108117 assertThat (deployment .getStatus ()).isEqualTo (AiDeploymentStatus .RUNNING );
109- assertThat (deployment .getSubmissionTime ()).isEqualTo ("2024-04-17T15:20:11Z " );
118+ assertThat (deployment .getSubmissionTime ()).isEqualTo ("2024-09-20T11:31:38Z " );
110119 assertThat (deployment .getTargetStatus ()).isEqualTo (AiDeployment .TargetStatusEnum .RUNNING );
111120 }
112121
@@ -234,10 +243,12 @@ void getDeploymentById() {
234243 "deploymentUrl": "https://api.ai.intprod-eu12.eu-central-1.aws.ml.hana.ondemand.com/v2/inference/deployments/db1d64d9f06be467",
235244 "details": {
236245 "resources": {
237- "backend_details": {}
246+ "backend_details": {},
247+ "backendDetails": {}
238248 },
239249 "scaling": {
240- "backend_details": {}
250+ "backend_details": {},
251+ "backendDetails": {}
241252 }
242253 },
243254 "id": "db1d64d9f06be467",
@@ -261,11 +272,8 @@ void getDeploymentById() {
261272 assertThat (deployment .getDeploymentUrl ())
262273 .isEqualTo (
263274 "https://api.ai.intprod-eu12.eu-central-1.aws.ml.hana.ondemand.com/v2/inference/deployments/db1d64d9f06be467" );
264- // Response contains key "backend_details" while spec (mistakenly) defines key "backendDetails".
265- assertThat (deployment .getDetails ().getResources ().getCustomFieldNames ())
266- .contains ("backend_details" );
267- assertThat (deployment .getDetails ().getScaling ().getCustomFieldNames ())
268- .contains ("backend_details" );
275+ assertThat (deployment .getDetails ().getResources ().getBackendDetails ()).isNotNull ();
276+ assertThat (deployment .getDetails ().getScaling ().getBackendDetails ()).isNotNull ();
269277 assertThat (deployment .getId ()).isEqualTo ("db1d64d9f06be467" );
270278 assertThat (deployment .getLastOperation ())
271279 .isEqualTo (AiDeploymentResponseWithDetails .LastOperationEnum .CREATE );
0 commit comments