java.lang.AssertionError: Expected: is "Administrator <root@localhost>" but: was ""

JIRA | Damian Jansen | 1 year ago
  1. 0

    Version-Release number of selected component (if applicable): 3.4 Description of problem: Rest test intermittent failure in jenkins. == Regression org.zanata.rest.service.TranslationResourceRestTest.headersAfterTranslating (from TestSuite) Failing for the past 1 build (Since #1838 ) Took 0.19 sec. Error Message Expected: is "Administrator <root@localhost>" but: was "" Stacktrace java.lang.AssertionError: Expected: is "Administrator <root@localhost>" but: was "" at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20) at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8) at org.zanata.rest.service.TranslationResourceRestTest.headersAfterTranslating(TranslationResourceRestTest.java:914) == Also, this test contains asserting for-loops which are not appropriate in tests, for safety and readability. In this particular case if the collection is empty, or the headers don't match, the test will pass which is incorrect. There are several instances of the same code behaviour in the above class, which should be altered to something like for (HeaderEntry entry : header.getEntries()) { somehashmap.put(entry.getKey(), entry.getValue.trim()) } assertThat(somehashmap.get(HeaderFields.KEY_LastTranslator), is("Administrator <root@localhost>")); assertThat(somehashmap.get(HeaderFields.KEY_PoRevisionDate).length(), greaterThan(0)); The behaviour of the above cannot otherwise be properly verified.

    JIRA | 1 year ago | Damian Jansen
    java.lang.AssertionError: Expected: is "Administrator <root@localhost>" but: was ""
  2. 0

    Version-Release number of selected component (if applicable): 3.4 Description of problem: Rest test intermittent failure in jenkins. == Regression org.zanata.rest.service.TranslationResourceRestTest.headersAfterTranslating (from TestSuite) Failing for the past 1 build (Since #1838 ) Took 0.19 sec. Error Message Expected: is "Administrator <root@localhost>" but: was "" Stacktrace java.lang.AssertionError: Expected: is "Administrator <root@localhost>" but: was "" at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20) at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8) at org.zanata.rest.service.TranslationResourceRestTest.headersAfterTranslating(TranslationResourceRestTest.java:914) == Also, this test contains asserting for-loops which are not appropriate in tests, for safety and readability. In this particular case if the collection is empty, or the headers don't match, the test will pass which is incorrect. There are several instances of the same code behaviour in the above class, which should be altered to something like for (HeaderEntry entry : header.getEntries()) { somehashmap.put(entry.getKey(), entry.getValue.trim()) } assertThat(somehashmap.get(HeaderFields.KEY_LastTranslator), is("Administrator <root@localhost>")); assertThat(somehashmap.get(HeaderFields.KEY_PoRevisionDate).length(), greaterThan(0)); The behaviour of the above cannot otherwise be properly verified.

    JIRA | 1 year ago | Damian Jansen
    java.lang.AssertionError: Expected: is "Administrator <root@localhost>" but: was ""
  3. 0

    Build fails during :sagan-site:integTest

    GitHub | 2 years ago | as1s
    java.lang.AssertionError: Expected: "Spring Tool Suiteâ„¢ Downloads" but: was "Spring Tool Suite™ Downloads"
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    RiverMongoInitialTimestampTest fails in isolation

    GitHub | 3 years ago | kdkeck
    java.lang.AssertionError: Expected: <0L> but: was <1L>
  6. 0

    installing allure jenkins plugin (v2.1) fails on latest jenkins build 1.576

    GitHub | 2 years ago | psura
    java.lang.AssertionError: Expected: is <2> but: was <1>

  1. olle.hallin 1 times, last 1 week ago
  2. davidvanlaatum 7 times, last 3 weeks ago
  3. cesarnog 1 times, last 2 months ago
  4. tfr 1 times, last 3 months ago
  5. qoomon 1 times, last 4 months ago
1 more registered users
3 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.AssertionError

    Expected: is "Administrator <root@localhost>" but: was ""

    at org.hamcrest.MatcherAssert.assertThat()
  2. Hamcrest
    MatcherAssert.assertThat
    1. org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
    2. org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
    2 frames
  3. org.zanata.rest
    TranslationResourceRestTest.headersAfterTranslating
    1. org.zanata.rest.service.TranslationResourceRestTest.headersAfterTranslating(TranslationResourceRestTest.java:914)
    1 frame