Skip to content

Commit

Permalink
expand test
Browse files Browse the repository at this point in the history
  • Loading branch information
jablan committed Dec 10, 2024
1 parent 2e82531 commit eb92049
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void tearDown() throws IOException {
* if the Api call fails
*/
@Test
public void keyCreateTest() throws ApiException {
public void keyCreateTest() throws ApiException, InterruptedException {
String body = "{\"id\":\"id_example\",\"name\":\"test-key-1\",\"created_at\": \"2015-01-28T09:52:53Z\"}";

MockResponse mockResponse = new MockResponse()
Expand All @@ -102,6 +102,10 @@ public void keyCreateTest() throws ApiException {
TranslationKeyDetails response = api.keyCreate(projectId, keyCreateParameters, xPhraseAppOTP);

Assert.assertEquals("valid id returned", "id_example", response.getId());
RecordedRequest recordedRequest = mockBackend.takeRequest();
Assert.assertEquals("Request path", "//projects/MY_PROJECT_ID/keys", recordedRequest.getPath());
String requestBody = recordedRequest.getBody().readUtf8();
Assert.assertEquals("Request body", "{\"name\":\"test-key-1\",\"plural\":false,\"data_type\":\"string\",\"max_characters_allowed\":2147483647,\"default_translation_content\":\"some test value which should be created and automatically translated in one call\",\"autotranslate\":true}", requestBody);
}

/**
Expand Down

0 comments on commit eb92049

Please sign in to comment.