-
Notifications
You must be signed in to change notification settings - Fork 35
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
positions storage tck #14
Conversation
void setUp() { | ||
dynamoDB.createTable(new CreateTableRequest( | ||
asList( | ||
new AttributeDefinition("topic", ScalarAttributeType.S), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz use constants from DynamoDBPositionsStorage
.concat( | ||
asDeferMono(() -> getStorage().update(getTopic(), groupId, 2, 2)), | ||
asDeferMono(() -> getStorage().update(getTopic(), groupId2, 2, 3)), | ||
asDeferMono(() -> getStorage().update(getTopic() + 1, groupId2, 2, 4)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
looks weird here, would be better to extract a variable and use a random topic name instead.
Also, probably makes sense to not have getTopic()
method at all, but use val topic = UUID.randomUUID().toString()
in every test
default void shouldSavePosition() { | ||
GroupId groupId = GroupId.ofString(UUID.randomUUID().toString()); | ||
|
||
Map<Integer, Long> positions = asDeferMono(() -> getStorage().update(getTopic(), groupId, 2, 2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if instead of asDeferMono
we use await(getStorage().update(getTopic(), groupId, 2, 2))
, where await
is something like:
<T> T await(CompletionStage<T> future) {
return future.toCompetableFuture().get(10, SECONDS);
}
?
import static java.util.Arrays.asList; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public interface PositionsStorageTests extends PositionsStorageTestSupport { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please split this into a few (akin Records Storage TCK)?
e.g. GroupsTest
, PersistenceTest
, etc.
It will also make it easy to add more tests & categories in future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks! 👍
No description provided.