Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace strings with constant values #39

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

seedspirit
Copy link
Contributor

Replaced all strings to constant values. String constants values are located in io/litmuschaos/constants directory

@jemlog
Copy link
Contributor

jemlog commented Dec 15, 2024

Hi @seedspirit, Can you replace strings in invitation endpoints to constant value?

@seedspirit
Copy link
Contributor Author

@jemlog I realized I missed the invitation api. Made commit to reflect it

@jemlog
Copy link
Contributor

jemlog commented Dec 17, 2024

LGTM!

// this.token = response.getAccessToken();
// return response;
// }
public String authenticate(LoginRequest request)
Copy link
Member

Choose a reason for hiding this comment

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

could you make a token class instead of returing string? it's for maintanence

Signed-off-by: BoGyum Kim | 김보겸 <[email protected]>
Signed-off-by: BoGyum Kim | 김보겸 <[email protected]>
private final LitmusHttpClient httpClient;
private final LitmusGraphQLClient graphQLClient;

public LitmusClient(String host, String token) {
public LitmusClient(String host, LitmusAuthToken token) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public LitmusClient(String host, LitmusAuthToken token) {
public LitmusClient(String host, String token) {

Can you get token as string and make like below?

this.token = new ListAuthToken(token);

// }
public LitmusAuthToken authenticate(LoginRequest request)
throws IOException, LitmusApiException {
LoginResponse response = httpClient.post(LOGIN, request, LoginResponse.class);
Copy link
Member

Choose a reason for hiding this comment

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

Is this code actually working?

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