Skip to content

Conversation

@marijahorvat171
Copy link
Collaborator

API can be used only with paid account; component not tested

@ivicac ivicac requested a review from monikakuster January 12, 2026 17:44
COMPANY_STATE, inputParameters.getString(COMPANY_STATE),
COMPANY_ZIPCODE, inputParameters.getString(COMPANY_ZIPCODE),
COMPANY_COUNTRY, inputParameters.getString(COMPANY_COUNTRY)))))))
.configuration(responseType(ResponseType.JSON))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using Body.of(Object... keyValueArray) or Body.of(String name, Object[] keyValueArray), as these may handle nulls more gracefully.

Please review all your perform methods: when using Map.of(key1, value1, ...), if any key or value is null, it will throw a NullPointerException.

For example, if inputParameters.getList(OUTPUT_FIELDS) or inputParameters.getString(COMPANY_NAME) returns null, the current implementation will fail at runtime.

Update the map creation logic to safely handle possible null values and avoid NPEs.

Copy link
Collaborator

@monikakuster monikakuster Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change still does not fully address the issue.

Please review the implementation of Body.of(Object... keyValueArray) and Body.of(String name, Object[] keyValueArray): these methods only add entries where both the key and value are non-null, and they require an even number of elements.

Simply replacing Map.of(...) with object arrays does not guarantee correct structure or adherence to the API specification—especially when the API expects nested maps (e.g., for matchCompanyInput).

To avoid NullPointerException and ensure your payload matches the API documentation, you should manually construct each map, including only those entries whose values are not null. This approach both prevents runtime errors and ensures the request body structure is valid for the API.

Object result = ZoominfoEnrichCompanyAction.perform(mockedParameters, mockedParameters, mockedContext);

assertEquals(mockedObject, result);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review the tests for this component and compare them with tests for previously implemented components.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marijahorvat171 tests are still not improved

COMPANY_STATE, inputParameters.getString(COMPANY_STATE),
COMPANY_ZIPCODE, inputParameters.getString(COMPANY_ZIPCODE),
COMPANY_COUNTRY, inputParameters.getString(COMPANY_COUNTRY)))))))
.configuration(responseType(ResponseType.JSON))
Copy link
Collaborator

@monikakuster monikakuster Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change still does not fully address the issue.

Please review the implementation of Body.of(Object... keyValueArray) and Body.of(String name, Object[] keyValueArray): these methods only add entries where both the key and value are non-null, and they require an even number of elements.

Simply replacing Map.of(...) with object arrays does not guarantee correct structure or adherence to the API specification—especially when the API expects nested maps (e.g., for matchCompanyInput).

To avoid NullPointerException and ensure your payload matches the API documentation, you should manually construct each map, including only those entries whose values are not null. This approach both prevents runtime errors and ensures the request body structure is valid for the API.

@sonarqubecloud
Copy link

@ivicac ivicac requested a review from monikakuster January 19, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants