Skip to content

Commit

Permalink
fix: normalize component not found error messages for GetConfiguratio…
Browse files Browse the repository at this point in the history
…n and UpdateConfiguration
  • Loading branch information
aws-kevinrickard committed Feb 10, 2024
1 parent 605bfaa commit d55536b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public GetConfigurationResponse handleRequest(GetConfigurationRequest request) {
Topics serviceTopics = kernel.findServiceTopic(finalServiceName);

if (serviceTopics == null) {
throw new ResourceNotFoundError(KEY_NOT_FOUND_ERROR_MESSAGE);
throw new ResourceNotFoundError(String.format(COMPONENT_NOT_FOUND_ERROR_FORMAT, finalServiceName));
}

Topics configTopics = serviceTopics.findInteriorChild(CONFIGURATION_CONFIG_KEY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void GIVEN_get_config_request_WHEN_component_requested_does_not_exist_THEN_fail(
request.setKeyPath(Collections.singletonList("AnyKey"));
ResourceNotFoundError error = assertThrows(ResourceNotFoundError.class, () ->
agent.getGetConfigurationHandler(mockContext).handleRequest(request));
assertEquals("Key not found", error.getMessage());
assertEquals("Component config not found for component WrongComponent", error.getMessage());
}

@Test
Expand Down

0 comments on commit d55536b

Please sign in to comment.