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

Added unit tests around config and other minor tweaks. #7

Merged
merged 12 commits into from
Jan 24, 2019

Conversation

rufusfnash
Copy link
Contributor

No description provided.

README.md Outdated Show resolved Hide resolved
Map<String, Object> sourceOffset = new HashMap<>();
sourceOffset.put(LAST_READ, lastRead);
sourceOffset.put(LAST_API_OFFSET, apiOffset);
return sourceOffset;
}

List<EventLog> getTppLogs(String token, String date, int offset) {
List<EventLog> getTppLogs(String token, String date, long offset) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should probably look at the whole file and figure out where to best auto-box and auto-unbox the Long...

props.put(BASE_URL_CONFIG, "https://localhost:443");
props.put(USERNAME_CONFIG, "placeholder_username");
props.put(PASSWORD_CONFIG, "placeholder_password");
return props;
Copy link
Contributor

Choose a reason for hiding this comment

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

If Guava is on the path, we could do return ImmutableMap.of()...; - looks nicer and ensures nobody messes with our config... 😇

}

private void given_this_is_overriden_with(String key, Object value, Map<String, Object> props) {
props.put(key, value);
Copy link
Contributor

Choose a reason for hiding this comment

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

wrap in assertNotNull()? (I seem to remember put will return an old value, if any?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True but I think you're then testing the test more than the intent which is simply the making sure the key value is set to the new values independent of if they were ever set previously.

Copy link
Contributor

Choose a reason for hiding this comment

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

the method says "overridden", not "set", though. 😇

}

private void given_this_is_removed_from(String key, Map<String, Object> props) {
props.remove(key);
Copy link
Contributor

Choose a reason for hiding this comment

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

wrap in assertTrue() for the reason detailed below? 😇

@rufusfnash rufusfnash dismissed chbalzer’s stale review January 24, 2019 15:42

I've made the changes in Intellij

@rufusfnash rufusfnash requested a review from chbalzer January 24, 2019 16:16
@@ -43,7 +43,7 @@ public void start(Map<String, String> props) {
@Override
public List<Map<String, String>> taskConfigs(int maxTasks) {
if (maxTasks != 1) {
throw new IllegalArgumentException("max Tasks should be set to 1.");
log.info("Ignoring maxTasks as there can only be one.");
Copy link
Contributor

Choose a reason for hiding this comment

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

we dub thee the Highlander setting... 🤡

Copy link
Contributor

@chbalzer chbalzer left a comment

Choose a reason for hiding this comment

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

One last comment... :)
#7 (comment)

@rufusfnash rufusfnash merged commit acf920b into master Jan 24, 2019
@pegerto pegerto deleted the config_def_test_and_validate branch January 24, 2019 16:59
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