Uploaded image for project: 'Samza'
  1. Samza
  2. SAMZA-387

Unit testing main methods is hard

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.8.0
    • None
    • container, yarn

    Description

      Both SamzaAppMaster and SamzaContainer are hard to unit test. I ran into this as part of SAMZA-382, but it's a recurring problem. The issue is that we have a lot of logic in the main() method that's not mockable.

      I think a good solution would be to write a helper class for things like environment variable, JmxServer, etc, and manage them all cleanly in an object that we can test, rather than in the main() method.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            criccomini Chris Riccomini

            Dates

              Created:
              Updated:

              Slack

                Issue deployment