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

Cbc UI d2 4454 cloud encryption operator #1175

Open
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

cody-constine-ttd
Copy link
Contributor

No description provided.


@Override
public long getVersion(JsonObject metadata) {
return Instant.now().getEpochSecond();
Copy link
Contributor

Choose a reason for hiding this comment

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

why isn't it metadata.getLong("version") ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this is using an API to get the data not a file, so there is no metadata to look the version up in. So I just used the time here to force a refresh everytime

Copy link
Contributor

Choose a reason for hiding this comment

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

This probably needs a comment explaining why you are doing this as I feel we will forget

public class RotatingCloudEncryptionKeyApiProvider extends RotatingCloudEncryptionKeyProvider {
private static final Logger LOGGER = LoggerFactory.getLogger(RotatingCloudEncryptionKeyApiProvider.class);

public ApiStoreReader<Map<Integer, CloudEncryptionKey>> apiStoreReader;
Copy link
Contributor

Choose a reason for hiding this comment

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

does this need to be public?

@@ -0,0 +1,73 @@
[ {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@thomasm-ttd thomasm-ttd left a comment

Choose a reason for hiding this comment

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

Small comments.


@Override
public long getVersion(JsonObject metadata) {
return Instant.now().getEpochSecond();
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably needs a comment explaining why you are doing this as I feel we will forget

.put(dataType, new JsonArray().add("value1").add("value2"));

List<TestData> expectedData = Arrays.asList(new TestData("value1"), new TestData("value2"));
when(mockParser.deserialize(any(InputStream.class)))
Copy link
Contributor

Choose a reason for hiding this comment

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

This test doesn't actually test if the input "contents" are used to return the result. It is only testing that loadContent will store the results of the parser.deserialize in the snapshot. I could change the contents array to have 3 values and the test would still pass.
You should validate properties of the any(InputStream.class) parameter.

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