Skip to content

Conversation

rashmiangadi11
Copy link
Collaborator

POC for create attachment

POC for create attachment
@rashmiangadi11 rashmiangadi11 changed the title SDMEXT-605POC for create attachment SDMEXT-616: Implementing user token flow;Ccahing of user token: basic create attachment flow Aug 5, 2024
Comment on lines 87 to 93
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this removed? Are you able to run UTs without this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added back

Comment on lines 1 to 3
/**************************************************************************
* (C) 2019-2024 SAP SE or an SAP affiliate company. All rights reserved. *
**************************************************************************/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove this

Comment on lines 78 to 79
var outbox = configurer.getCdsRuntime().getServiceCatalog().getService(OutboxService.class,
OutboxService.PERSISTENT_UNORDERED_NAME);//need to check if required
Copy link
Collaborator

Choose a reason for hiding this comment

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

IS this needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is required now as for a method its mandatory can be removed later

Comment on lines 120 to 122
if (cachedToken == null) {
cachedToken= generateDITokenFromTokenExchange(token,sdmCredentials,payloadObj);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are not caching DI token?

}
return cachedToken;
}
public static String getDIToken(String token,SDMCredentials sdmCredentials) throws OAuth2ServiceException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please fix indentation. Put spaces between method parameters

cacheKey.setExpiration(token_expiry);
String cachedToken = CacheConfig.getUserTokenCache().get(cacheKey);
if (cachedToken == null) {
cachedToken= generateDITokenFromTokenExchange(token,sdmCredentials,payloadObj);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please fix indentation. Put spaces between method parameters

return cachedToken;
}

private static String generateDITokenFromTokenExchange(String token,SDMCredentials sdmCredentials,JsonObject payloadObj)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please fix indentation. Put spaces between method parameters


private static String generateDITokenFromTokenExchange(String token,SDMCredentials sdmCredentials,JsonObject payloadObj)
throws OAuth2ServiceException {
String cachedToken =null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please fix indentation. Put spaces after =

@rishikunnath2747 rishikunnath2747 self-requested a review August 5, 2024 13:40
Copy link
Collaborator

Choose a reason for hiding this comment

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

On line 17, is it fine to hardcode that value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed it

pom.xml Outdated
Comment on lines 87 to 86
<artifactId>junit-jupiter-api</artifactId>
<artifactId>junit-jupiter</artifactId>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be junit-jupiter-api

Comment on lines 103 to 110
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.12.0</version>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add this version back

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