Skip to content

Conversation

@moirf
Copy link

@moirf moirf commented Nov 30, 2022

Purpose

  • ...

Does this introduce a breaking change?

[ ] Yes
[ ] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

{
String logMessage;
logMessage = messageType + " " + message;
System.out.println(logMessage);
Copy link

@Ninika Ninika Dec 20, 2022

Choose a reason for hiding this comment

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

nit: spacing alignment issue

Choose a reason for hiding this comment

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

Resolved


Logger.logMessage(Logger.MessageType.INFORMATION, "AnswerCallWithResponse -- > " + getResponse(response));
Logger.logMessage(Logger.MessageType.INFORMATION, "Call Connection ID -- > " + answerCallResult.getCallConnectionProperties().getCallConnectionId());

Copy link

Choose a reason for hiding this comment

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

nit: spacing alignment issue

Choose a reason for hiding this comment

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

Resolved

@PostMapping(value = "/OnIncomingCall", consumes = "application/json", produces = "application/json")
public ResponseEntity<?> OnIncomingCall(@RequestBody(required = false) String data){
List<EventGridEvent> eventGridEvents = EventGridEvent.fromString(data);

Copy link

Choose a reason for hiding this comment

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

extra line

Choose a reason for hiding this comment

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

Resolved

List<EventGridEvent> eventGridEvents = EventGridEvent.fromString(data);

if(eventGridEvents.stream().count() > 0)
{
Copy link

Choose a reason for hiding this comment

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

please indent the code.. keep the brackets at the right spacing

Choose a reason for hiding this comment

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

Resolved

EventGridEvent eventGridEvent = eventGridEvents.get(0);
BinaryData eventData = eventGridEvent.getData();

if (eventGridEvent.getEventType().equals(SystemEventNames.EVENT_GRID_SUBSCRIPTION_VALIDATION))
Copy link

Choose a reason for hiding this comment

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

You can change it to SystemEventNames.EVENT_GRID_SUBSCRIPTION_VALIDATION.equals(eventGridEvent.getEventType()) to avoid null pointers.
Also check if eventGridEvent could be null

Choose a reason for hiding this comment

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

Done

SubscriptionValidationEventData subscriptionValidationEvent = eventData.toObject(SubscriptionValidationEventData.class);
SubscriptionValidationResponse responseData = new SubscriptionValidationResponse();
responseData.setValidationResponse(subscriptionValidationEvent.getValidationCode());

Copy link

Choose a reason for hiding this comment

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

extra line spacing

Choose a reason for hiding this comment

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

Resolved

return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
else if(eventGridEvent.getEventType().equals("Microsoft.Communication.IncomingCall")){
Copy link

Choose a reason for hiding this comment

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

Indent the code

Choose a reason for hiding this comment

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

Resolved

}
}
catch(Exception e){
e.printStackTrace();
Copy link

Choose a reason for hiding this comment

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

indentation is off here

Choose a reason for hiding this comment

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

Resolved

Copy link

@Ninika Ninika left a comment

Choose a reason for hiding this comment

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

Please incorporate the requested comments

…TION.equals(eventGridEvent.getEventType()) && eventGridEvent!=null
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