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

Add GetObjectApiTest, PutObjectsApiTest, ListKeyVersionsApiTest #12

Merged
merged 2 commits into from
Jun 15, 2023

Conversation

G8XSU
Copy link
Collaborator

@G8XSU G8XSU commented May 25, 2023

Depends on #10

}

@Test
void execute_ValidPayload_ReturnsResponse() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i tried creating a common base testcase but it was more complex and less readable since many api specific calls are interleaved.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these are the abstract methods a sub-test would have had to implement in that case, and it seemed difficult to understand test-case.

  abstract void beforeEachSetup();
  
  abstract void verifyAfterTest();

  abstract GeneratedMessageV3 createExpectedRequest();

  abstract GeneratedMessageV3 createExpectedResponse();
  
  abstract Response executeValidRequest();

  abstract Response executeErroringRequest(Class<? extends Exception> exceptionClass)
      throws Exception;
      

.build();
byte[] payload = expectedRequest.toByteArray();
when(mockKVStore.get(any())).thenThrow(
exceptionClass.getDeclaredConstructor(String.class).newInstance("errorMsg"));
Copy link

Choose a reason for hiding this comment

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

Wouldn't be simpler to pass in the constructed exception?

@G8XSU
Copy link
Collaborator Author

G8XSU commented Jun 14, 2023

Hi @jkczyz
Will you be reviewing #10 separately or should i merge just this combined PR ?

@jkczyz
Copy link

jkczyz commented Jun 15, 2023

Hi @jkczyz Will you be reviewing #10 separately or should i merge just this combined PR ?

I think you can just merged the combined PR and close #10.

@G8XSU G8XSU merged commit 16818cf into lightningdevkit:main Jun 15, 2023
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.

2 participants