Skip to content

Commit

Permalink
use assertj-core 3.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
istsergey authored and croesch committed Nov 19, 2018
1 parent 9dc702c commit 3802390
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import static org.assertj.core.util.Strings.quote;

import java.io.File;

import org.assertj.core.api.exception.RuntimeIOException;
import java.io.IOException;
import java.io.UncheckedIOException;

/**
* Understands creation of folders.
Expand All @@ -38,7 +38,12 @@ File createFolder(File parent, String name, boolean deleteIfExists) {
imageFolder.mkdir();
return imageFolder;
} catch (Exception e) {
throw new RuntimeIOException(concat("Unable to create directory ", quote(name)), e);
String message = concat("Unable to create directory ", quote(name));

if (e instanceof IOException) {
throw new UncheckedIOException(message, (IOException) e);
}
throw new RuntimeException(message, e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.io.File;
import java.io.IOException;

import org.assertj.core.api.exception.RuntimeIOException;
import org.easymock.EasyMock;
import org.fest.mocks.EasyMockTemplate;
import org.junit.BeforeClass;
Expand Down Expand Up @@ -81,7 +80,7 @@ protected void codeToTest() {
try {
creator.createFolder(f, "hello", true);
fail("expecting exception");
} catch (RuntimeIOException e) {
} catch (RuntimeException e) {
assertThat(e).hasMessage("Unable to create directory 'hello'");
assertThat(e.getCause()).isSameAs(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import static org.assertj.swing.util.Strings.isNullOrEmpty;

import java.io.File;

import org.assertj.core.api.exception.RuntimeIOException;
import org.testng.ITestContext;

/**
Expand Down Expand Up @@ -47,6 +45,6 @@ void createIfNecessary() {
return;
if (f.mkdirs())
return;
throw new RuntimeIOException(concat("Unable to create output directory ", path));
throw new RuntimeException(concat("Unable to create output directory ", path));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import static org.easymock.classextension.EasyMock.createMock;

import java.io.File;

import org.assertj.core.api.exception.RuntimeIOException;
import org.fest.mocks.EasyMockTemplate;
import org.junit.After;
import org.junit.Before;
Expand Down Expand Up @@ -95,7 +93,7 @@ protected void codeToTest() {
}.run();
}

@Test(expected = RuntimeIOException.class)
@Test(expected = RuntimeException.class)
public void should_Throw_Error_If_Output_Folder_Cannot_Be_Created() {
File folder = newFolder(unwritablePath);
assertThat(folder.setReadOnly()).isTrue();
Expand Down
2 changes: 1 addition & 1 deletion assertj-swing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.8.0</version>
<version>3.11.1</version>
</dependency>

<dependency>
Expand Down

0 comments on commit 3802390

Please sign in to comment.