Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-20415

(7.3.z) KeyStoresTestCase wrongly rounds days which leads to a failure in case of different daylight saving time

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.3.5.GA, 7.3.5.CR1
    • None
    • Test Suite
    • None

      Tests run: 29, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 12.721 s <<< FAILURE! - in org.wildfly.extension.elytron.KeyStoresTestCase
      testGenerateKeyPair(org.wildfly.extension.elytron.KeyStoresTestCase)  Time elapsed: 0.31 s  <<< FAILURE!
      java.lang.AssertionError: expected:<365> but was:<364>
      	at org.wildfly.extension.elytron.KeyStoresTestCase.testGenerateKeyPair(KeyStoresTestCase.java:559)
      

      KeyStoresTestCase wrongly rounds days which leads to a failure in case of different daylight saving time between the creation and expiration of a testing certificate, see https://github.com/wildfly/wildfly-core/blob/master/elytron/src/test/java/org/wildfly/extension/elytron/KeyStoresTestCase.java#L559

                  Date notBefore = certificate.getNotBefore();
                  Date notAfter = certificate.getNotAfter();
                  assertEquals(365, (notAfter.getTime() - notBefore.getTime()) / (1000 * 60 * 60 * 24));
      

            istudens@redhat.com Ivo Studensky
            istudens@redhat.com Ivo Studensky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: