Skip to content

Commit 5bc4200

Browse files
committed
- F SimpleLogger.quiet() now uses QuietAutoCloseable
1 parent 0fb1d70 commit 5bc4200

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

approvaltests-tests/src/test/java/org/approvaltests/CheckedExceptionsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
public class CheckedExceptionsTest
1818
{
1919
@Test
20-
void testTheVerifyApi() throws Exception
20+
void testTheVerifyApi()
2121
{
2222
try (var l = SimpleLogger.quiet())
2323
{

approvaltests-tests/src/test/java/org/approvaltests/TestFilesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public class TestFilesTest
1515
{
1616
@Test
17-
void testTestFileNamesEndInTest() throws Exception
17+
void testTestFileNamesEndInTest()
1818
{
1919
try (var __ = SimpleLogger.quiet())
2020
{

approvaltests-tests/src/test/java/org/approvaltests/reporters/GenericDiffReporterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void testIsImage()
8080
GenericDiffReporter.isFileExtensionValid(a, GenericDiffReporter.IMAGE_FILE_EXTENSIONS)));
8181
}
8282
@Test
83-
void testRunningNonExistantFile() throws Exception
83+
void testRunningNonExistantFile()
8484
{
8585
try (var l = SimpleLogger.quiet())
8686
{

approvaltests-util-tests/src/test/java/com/spun/util/DatabaseUtilsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
public class DatabaseUtilsTest
99
{
1010
@Test
11-
public void testTransaction() throws Exception
11+
public void testTransaction()
1212
{
13-
try (AutoCloseable quiet = SimpleLogger.quiet())
13+
try (var __ = SimpleLogger.quiet())
1414
{
1515
MockConnection connection1 = new MockConnection();
1616
MockConnection connection2 = new MockConnection();
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.spun.util;
2+
3+
public interface QuietAutoCloseable extends AutoCloseable
4+
{
5+
void close();
6+
}

approvaltests-util/src/main/java/com/spun/util/logger/SimpleLogger.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.spun.util.logger;
22

3+
import com.spun.util.QuietAutoCloseable;
34
import com.spun.util.SingleWrapper;
45
import com.spun.util.ThreadedWrapper;
56
import com.spun.util.Wrapper;
@@ -144,7 +145,7 @@ public static SimpleLoggerInstance get()
144145
{
145146
return wrapper.get();
146147
}
147-
public static AutoCloseable quiet()
148+
public static QuietAutoCloseable quiet()
148149
{
149150
Appendable originalLogTo = getLogTo();
150151
logToNothing();

0 commit comments

Comments
 (0)