mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 00:58:24 +00:00
deps: Refactor dependencies (#3224)
* remove spring dep move junit, logging, mockito under dep mgmt * upgrade anti-corruption-layer deps * async method invocation * balking, bloc * bridge to bytecode * caching * callback - cqrs * component - health check * hexagonal - metadata mapping * rest of the patterns * remove checkstyle, take spotless into use
This commit is contained in:
@@ -31,14 +31,12 @@ import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Tests execute-around example.
|
||||
*/
|
||||
/** Tests execute-around example. */
|
||||
class AppTest {
|
||||
|
||||
@Test
|
||||
void shouldExecuteApplicationWithoutException() {
|
||||
assertDoesNotThrow(() -> App.main(new String[]{}));
|
||||
assertDoesNotThrow(() -> App.main(new String[] {}));
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
|
||||
@@ -38,15 +38,11 @@ import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.migrationsupport.rules.EnableRuleMigrationSupport;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
||||
/**
|
||||
* SimpleFileWriterTest
|
||||
*
|
||||
*/
|
||||
/** SimpleFileWriterTest */
|
||||
@EnableRuleMigrationSupport
|
||||
class SimpleFileWriterTest {
|
||||
|
||||
@Rule
|
||||
public final TemporaryFolder testFolder = new TemporaryFolder();
|
||||
@Rule public final TemporaryFolder testFolder = new TemporaryFolder();
|
||||
|
||||
@Test
|
||||
void testWriterNotNull() throws Exception {
|
||||
@@ -74,12 +70,19 @@ class SimpleFileWriterTest {
|
||||
assertTrue(Files.lines(temporaryFile.toPath()).allMatch(testMessage::equals));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testRipplesIoExceptionOccurredWhileWriting() {
|
||||
var message = "Some error";
|
||||
final var temporaryFile = this.testFolder.newFile();
|
||||
assertThrows(IOException.class, () -> new SimpleFileWriter(temporaryFile.getPath(), writer -> {throw new IOException("error");}), message);
|
||||
assertThrows(
|
||||
IOException.class,
|
||||
() ->
|
||||
new SimpleFileWriter(
|
||||
temporaryFile.getPath(),
|
||||
writer -> {
|
||||
throw new IOException("error");
|
||||
}),
|
||||
message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user