Build: #1174 was successful Scheduled with changes by teleivo <mrteleivo@gmail.com> and Ivo Ulrich <teleivo@users.noreply.github.com>

Code commits

openmrs-core master

  • Ivo Ulrich <teleivo@users.noreply.github.com>

    Ivo Ulrich <teleivo@users.noreply.github.com> e2a5df531ed0827595c8edab9ca7b5b76a6b00f1

    Merge pull request #2106 from teleivo/cohortvalidatortest
    Cleanup and add tests to CohortValidatorTest

  • teleivo <mrteleivo@gmail.com>

    teleivo <mrteleivo@gmail.com> d36e84be5afb578d2994b61faaa080c78d974319

    Cleanup and add tests to CohortValidatorTest
    * add setUp method preparing variables needed for tests to remove
    duplication in test setup
    * add tests to assert IllegalArgumentException is thrown when
    validating null or an instance other than Cohort

    • api/src/test/java/org/openmrs/validator/CohortValidatorTest.java (version d36e84be5afb578d2994b61faaa080c78d974319)
  • Ivo Ulrich <teleivo@users.noreply.github.com>

    Ivo Ulrich <teleivo@users.noreply.github.com> a0cd91742cf61738a7d48fda1ac8fdd111469614

    Merge pull request #2104 from teleivo/codetemplates
    Remove throws Exception from IDE code templates

  • teleivo <mrteleivo@gmail.com>

    teleivo <mrteleivo@gmail.com> 1695eb7ec7d436b56a3de5c0821c64c2a73efbef

    Remove throws Exception from IDE code templates
    there is no need for the throws Exception clauses in the tests
    therefore removed it from the intellij and eclipse templates

    • tools/src/main/resources/eclipse/templates.xml (version 1695eb7ec7d436b56a3de5c0821c64c2a73efbef)
    • tools/src/main/resources/intellij/templates.xml (version 1695eb7ec7d436b56a3de5c0821c64c2a73efbef)
  • Ivo Ulrich <teleivo@users.noreply.github.com>

    Ivo Ulrich <teleivo@users.noreply.github.com> 3f2f4d015a2ef0d09b4f26dab9dd099c00e4b90a

    Merge pull request #2103 from teleivo/baseattributetypevalidatortest
    Clean and add tests to BaseAttributeTypeValidatorTest

  • teleivo <mrteleivo@gmail.com>

    teleivo <mrteleivo@gmail.com> eb56f8ccc8026473eb42f443fcba819a22f89e93

    Clean and add tests to BaseAttributeTypeValidatorTest
    * replace the VisitAttributeTypeValidator with an implementation added
    to this test class. Reason is the VisitAttributeTypeValidator does some
    things before calling super.validate which prevents us from testing
    validate(null, errors)
    * add test for validate(null, errors)
    * add test for minOccurs < 0
    * add test for datatypeConfig is blank when of type RegexValidatedTextDatatype
    * rename test shouldRequireDatatypeConfigurationIfDatatypeEqualsRegexValidatedText
    which was actually testing the datatypeConfig.invalid path
    * add test for wrong preferred handler type
    * add test for invalid handlerConfig
    * arrange tests to match code so reading code/test side by side is easy
    * move happy path to the end

    • api/src/test/java/org/openmrs/validator/BaseAttributeTypeValidatorTest.java (version eb56f8ccc8026473eb42f443fcba819a22f89e93)
  • Ivo Ulrich <teleivo@users.noreply.github.com>

    Ivo Ulrich <teleivo@users.noreply.github.com> 83b0f68f6fc266e36d213238db217c9fbe53d084

    Merge pull request #2102 from teleivo/allergyvalidatortest
    Extract setUp and fix tests in AllergyValidatorTest

  • teleivo <mrteleivo@gmail.com>

    teleivo <mrteleivo@gmail.com> c064839b4a8b820d15430c95b0f64976eea92497

    Extract setUp and fix tests in AllergyValidatorTest
    fixed errors in AllergyValidatorTest's, a few tests where just
    asserting that the "allergen" field had an error but not the actual
    code which lead to the fact that a few paths where not tested because the
    Allergy passed in did not match the test expectations (either the
    Allergen was null or the AllergenType of the Allergen not set)

    * fixed test 'shouldFailIdAllergenTypeIsNull' which passed because
    due to "allergyapi.allergen.required" coming from Allergen being null
    not from the AllergenType
    added assertion for the correct error code and passed in an Allergen to the
    Allergy with no AllergenType

    * add setUp method preparing variables needed for tests to remove
    duplication in test setup
    * arrange test implementations in a arrange, act, assert style (or what
    we often called the given,when,then) so its clear to see whats been
    tested and what the outcome should be
    * move test 'validate_shouldFailIfAllergenIsNull' one up to match the
    flow of the code. makes it easy to read code / test side by side
    * removed one duplicate call to validate

    • api/src/test/java/org/openmrs/validator/AllergyValidatorTest.java (version c064839b4a8b820d15430c95b0f64976eea92497)
  • Ivo Ulrich <teleivo@users.noreply.github.com>

    Ivo Ulrich <teleivo@users.noreply.github.com> 22d97e747655322d2309e0c21b580f4472535550

    Merge pull request #2101 from teleivo/alertvalidatortest
    Extract setUp and clean AlertValidatorTest

  • teleivo <mrteleivo@gmail.com>

    teleivo <mrteleivo@gmail.com> 58f4e9b08a2f505efe5f741d0ea014c6adb43786

    Extract setUp and clean AlertValidatorTest
    * add setUp method preparing variables needed for tests to remove
    duplication in test setup
    * arrange test implementations in a arrange, act, assert style (or what
    we often called the given,when,then) so its clear to see whats been
    tested and what the outcome should be
    * split test that tested null/empty/whitespace of alert text in a
    single test as these are independent

    • api/src/test/java/org/openmrs/validator/AlertValidatorTest.java (version 58f4e9b08a2f505efe5f741d0ea014c6adb43786)
  • Ivo Ulrich <teleivo@users.noreply.github.com>

    Ivo Ulrich <teleivo@users.noreply.github.com> f42c653594b3f69227c1e40b0f9b861d29d4fbd7

    Merge pull request #2100 from teleivo/personnamevalidator-test
    Extract setUp in PersonNameValidatorTest

  • teleivo <mrteleivo@gmail.com>

    teleivo <mrteleivo@gmail.com> 5c6969404794b45244994c25ece8868d08f6b44e

    Extract setUp in PersonNameValidatorTest
    * add setUp method preparing variables needed for tests to remove
    duplication in test setup
    * arrange test implementations in a arrange, act, assert style (or what
    we often called the given,when,then) so its clear to see whats been
    tested and what the outcome should be
    * remove unnecessary throws Exception from method declarations

    • api/src/test/java/org/openmrs/validator/PersonNameValidatorTest.java (version 5c6969404794b45244994c25ece8868d08f6b44e)
  • Ivo Ulrich <teleivo@users.noreply.github.com>

    Ivo Ulrich <teleivo@users.noreply.github.com> 66b9f0f7e42928598e603edb73bb16cf9f91f944

    Merge pull request #2097 from teleivo/encountervalidator-test
    Add tests to EncounterValidatorTest

  • teleivo <mrteleivo@gmail.com>

    teleivo <mrteleivo@gmail.com> 4bbfc6f4855abfe15c065b1a090c227f6d130130

    Add tests to EncounterValidatorTest
    * add tests to EncounterValidatorTest for when validation is given null or
    instance of class other than Encounter
    * add setUp method preparing variables needed for tests to remove
    duplication in test setup
    * arrange test implementations in a arrange, act, assert style (or what
    we often called the given,when,then) so its clear to see whats been
    tested and what the outcome should be

    • api/src/test/java/org/openmrs/validator/EncounterValidatorTest.java (version 4bbfc6f4855abfe15c065b1a090c227f6d130130)