Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@FrankGasparovic
Copy link

No description provided.

@FrankGasparovic
Copy link
Author

Copy link
Collaborator

@irinaepshteyn irinaepshteyn left a comment

Choose a reason for hiding this comment

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

Done reviewing. Please review my comments. Let me know if you would like me to make these changes and merge.


PolicyEvaluationResult result = mockPermitResult();
spiedCache.set(key, result);
spiedCache.get(key);
Copy link
Collaborator

Choose a reason for hiding this comment

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

@FrankGasparovic, need to validate if get() correctly returned a cached result or null.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@FrankGasparovic, also connectorsNotConfigured() test case should return:

new Object[] { null, null, DateTime.now(), false };

private static PolicyEvaluationResult mockPermitResult() {
PolicyEvaluationResult result = new PolicyEvaluationResult(Effect.PERMIT);
result.setResolvedResourceUris(new HashSet<>(Arrays.asList(new String[] { XFILES_ID })));
result.setResolvedResourceUris(new HashSet<>(Collections.singletonList(XFILES_ID)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Collections.singleton(..) instead of new HashSet<>(Collections.singletonList(..))


Thread.sleep(1);
this.cache.resetForSubjectsByIds(ZONE_NAME, new HashSet<>(Arrays.asList(AGENT_MULDER)));
this.cache.resetForSubjectsByIds(ZONE_NAME, new HashSet<>(Collections.singletonList(AGENT_MULDER)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Collections.singleton(..) instead of new HashSet<>(Collections.singletonList(..))


Thread.sleep(1);
this.cache.resetForResourcesByIds(ZONE_NAME, new HashSet<>(Arrays.asList(XFILES_ID)));
this.cache.resetForResourcesByIds(ZONE_NAME, new HashSet<>(Collections.singletonList(XFILES_ID)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Collections.singleton(..) instead of new HashSet<>(Collections.singletonList(..))

}

private Object[] connectorsNotConfigured() {
AttributeConnector resourceConnector = new AttributeConnector();
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this statement and the one below since they're unused

@anubhavi25 anubhavi25 merged commit 6bfecfc into develop Aug 16, 2017
@anubhavi25 anubhavi25 deleted the DE41034 branch August 16, 2017 17:50
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.

4 participants