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

Skip to content

Conversation

@FrankGasparovic
Copy link

No description provided.

Copy link
Contributor

@sanjeevchopra sanjeevchopra left a comment

Choose a reason for hiding this comment

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

Didnt have a chance to review the whole change, I have one comment though.
@anubhavi25 please review the PR

@@ -0,0 +1,49 @@
package com.ge.predix.audit.rest;

public class PredixAuditRequest {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move this, response and AuditRecord classes to integration-test project if they are not used by the service.

} catch (VcapLoadException e) {
e.printStackTrace();
}
AuditClient auditClient = new AuditClient(sdkConfig, auditCallback());
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not look right createAuditClient needs to throw an except when it fails but here we are catching the vLoadException and still initializing the auditClient

return auditClient;
}

public AuditCallback auditCallback() {
Copy link
Contributor

Choose a reason for hiding this comment

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

If AuditCallBack class is only use for integration tests then we should move to IntegrationTest project as mentioned by Sanjeev earlier.

@FrankGasparovic FrankGasparovic force-pushed the US65642 branch 2 times, most recently from da71da1 to 080d980 Compare March 21, 2017 19:49
@Autowired
private AuditClient auditClient;
// Remove this and use configuration eventually
private static final Set<String> EXCLUSIONS = Collections.singleton("/connector");
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be /v1/connector since our APIs are prefixed with the version? Also, once #103 is in develop, this should change to Collections.singleton(AcsApiUriTemplates.V1 + AcsApiUriTemplates.CONNECTOR_URL) to prevent hardcoding the URI path.


private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(ACSAuditConfiguration.class);

private VcapLoaderServiceImpl vcapLoaderService = new VcapLoaderServiceImpl();
Copy link
Contributor

Choose a reason for hiding this comment

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

Make this static final since we should only need to do this once?


private VcapLoaderServiceImpl vcapLoaderService = new VcapLoaderServiceImpl();

private AuditConfiguration sdkConfig;
Copy link
Contributor

Choose a reason for hiding this comment

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

Field can be converted to a local variable in the auditClient bean below (since it's only used there)

@Test
public void testControllerExclusions() {
AuditEvent auditEvent = Mockito.mock(AuditEvent.class);
Mockito.doReturn("http://acs.com/connector/test123").when(auditEvent).getRequestUri();
Copy link
Contributor

Choose a reason for hiding this comment

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

If you make the change above to use /v1/connector, change this test as well

@anubhavi25 anubhavi25 dismissed their stale review March 22, 2017 00:46

Frank has addressed my comments

@anubhavi25 anubhavi25 merged commit 4ccfff8 into develop Mar 22, 2017
@anubhavi25 anubhavi25 deleted the US65642 branch March 22, 2017 00:46
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.

5 participants