yuskam / catch-exception

Automatically exported from code.google.com/p/catch-exception
0 stars 0 forks source link

catch-exception incompatible with newest assertj-core-1.7.0 #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use catch-exception-1.2.0
2. Use assertj-core-1.7.0
3. Execute JUnit Test from below:

@Test
public void builderShouldThrowExceptionForNullHiddenForUserIds() throws 
Exception {
   // given
   List myList = new ArrayList();

   // when
   when(myList).get(1);

   // then
   then(caughtException()).isExactlyInstanceOf(IndexOutOfBoundsException.class);
}

What is the expected output? What do you see instead?

Expected no error at all.

Got instead the error below:

java.lang.NoSuchMethodError: 
org.assertj.core.api.Assertions.assertThat(Ljava/lang/Throwable;)Lorg/assertj/co
re/api/ThrowableAssert;
    at com.googlecode.catchexception.apis.CatchExceptionAssertJ.then(CatchExceptionAssertJ.java:148)

What version of the product are you using? On what operating system?
* catch-exception-1.2.0 in combination with assertJ 1.7.0.
* Windows 7 x64 (SP 1)
* Java 1.7.0 update 72

Please provide any additional information below.

assertJ 1.6.1 contains:
public static ThrowableAssert assertThat(Throwable actual) {
    return new ThrowableAssert(actual);
}

assertJ 1.7.0 contains signature change:
public static AbstractThrowableAssert<?, ? extends Throwable> 
assertThat(Throwable actual) {
    return new ThrowableAssert(actual);
}

Original issue reported on code.google.com by bahram.p...@gmail.com on 20 Oct 2014 at 9:21

GoogleCodeExporter commented 8 years ago
Fix: 
https://github.com/Codearte/catch-exception/commit/6fb684a4e27d43b81486c1fa0d996
43350fa31c6

Original comment by mariu...@gmail.com on 22 Oct 2014 at 8:56

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Thank you for the fix, Mariusz!

You have already released a new version: 
http://search.maven.org/#artifactdetails%7Ceu.codearte.catch-exception%7Ccatch-e
xception-parent%7C1.3.0%7Cpom

The release contains the fix. Thank you!

Best regards
Rod 

Original comment by rwoo@gmx.de on 26 Oct 2014 at 1:04

GoogleCodeExporter commented 8 years ago
New version is comming with support for older assertj :)

Original comment by mariu...@gmail.com on 27 Oct 2014 at 3:33