Skip to content

Commit

Permalink
add unit test for params being empty
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomallada1 committed Oct 17, 2024
1 parent 053cea1 commit 4413c82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public DeliveryResult deliver(BIBO bibo, String appId, String serviceId) throws

JsonNode delivery = client.rpc(client.getURI(FidesmoApiClient.SERVICE_DELIVER_URL), deliveryRequest);
String sessionId = delivery.get("sessionId").asText();

logger.info("Delivering: {}", FidesmoApiClient.lamei18n(description.get("title")));
logger.info("Session ID: {}", sessionId);

Expand Down
9 changes: 9 additions & 0 deletions library/src/test/java/com/fidesmo/fdsm/TranslationsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ public void returnMessagesInNewFormatWithoutParams() throws JsonProcessingExcept
ObjectMapper objectMapper = new ObjectMapper();
JsonNode jsonNode = objectMapper.readTree(jsonString);

assertEquals(FidesmoApiClient.lamei18n(jsonNode), "Your card has been removed");
}
@Test
public void returnMessagesInNewFormatWithEmptyParams() throws JsonProcessingException {
String jsonString = "{ \"id\": \"service.statuses.success\", \"text\": \"Your card has been removed\", \"params\": []}";

ObjectMapper objectMapper = new ObjectMapper();
JsonNode jsonNode = objectMapper.readTree(jsonString);

assertEquals(FidesmoApiClient.lamei18n(jsonNode), "Your card has been removed");
}
}

0 comments on commit 4413c82

Please sign in to comment.