Skip to content

Conversation

@jfeingold35
Copy link
Contributor

This PR does the following:

  • Adds @NamespaceAccessible-annotated methods as valid sources for ApexFlsViolationRule.
  • A few relevant refactors of test code.

trim_trailing_whitespace = true
insert_final_newline = true

[*.java]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The yarn build task does some automatic refactoring of the code, and one of the changes it does is tabs-to-spaces. So might as well have code be written with spaces by default.
(Personally, my preference is tabs, but I don't think I care enough to pick a fight about it.)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is possibly caused by our addition of googleformat to gradle build. I'm okay with either. Though I suppose switching back to tabs is going to create a large CL.

return getMethodsWithAnnotation(g, targetFiles, Schema.NAMESPACE_ACCESSIBLE);
}

static List<MethodVertex> getMethodsWithAnnotation(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Package-private instead of true-private, so that we can have one parameterized test for this method instead of a bunch of tests for each invocation of it.

* other types of vertices that are excluded from the query. Exclude test classes and methods
*/
@Test
public void testGetAuraEnabledMethods() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason, we have two MethodUtilTest.java files. This one is in build instead of ops, which led me to conclude that it's the one that should ultimately be deleted. But for now, I'm just moving the Aura-Enabled test into the other file.

containsString(EventKey.WARNING_MULTIPLE_METHOD_TARGET_MATCHES.getMessageKey()));
}

@ValueSource(strings = {Schema.AURA_ENABLED, Schema.NAMESPACE_ACCESSIBLE})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a parameterized refactor of the aura-enabled test in the other test file, also covering NamespaceAccessible and any other annotations we add support for.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also have a test at a higher level to see if NameAccessible annotations are recognized as entry points?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably. I'll add that first thing tomorrow.

@jfeingold35 jfeingold35 merged commit 3ed56f4 into dev-3 Jun 24, 2022
@jfeingold35 jfeingold35 deleted the d/W-10459675 branch September 14, 2022 18:17
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