GitHub user ottobackwards opened a pull request:

    METRON-1299 In MetronError tests, don't test for HostName if getHostName 
wouldn't work

    MetronError ignores exceptions from 
InetAddress.getLocalHost().getHostName() and leaves the field unset.
    The unit test however assumes it would be set, and someone has logged a 
jira on this, since it makes the build fail.
    Changed the test so that it only verifies the hostName if it would have 
    ### Testing
    - Code review
    - Tests Pass
    > no non-test changes in pr
     private void addHostname(JSONObject errorMessage) {
        try {
        } catch (UnknownHostException ex) {
          // Leave the hostname field off if it cannot be found
    ### For all changes:
    - [x] Is there a JIRA ticket associated with this PR? If not one needs to 
be created at [Metron 
    - [x] Does your PR title start with METRON-XXXX where XXXX is the JIRA 
number you are trying to resolve? Pay particular attention to the hyphen "-" 
    - [x] Has your PR been rebased against the latest commit within the target 
branch (typically master)?

You can merge this pull request into a Git repository by running:

    $ git pull error_addHost

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #924
commit cee3acba914f97ca7d2faf6e7822c97928a4e242
Author: Otto Fowler <ottobackwards@...>
Date:   2018-02-02T21:57:47Z

    do not test for hostName if calling hostName throws, since it will be null



Reply via email to