Skip to content

Commit

Permalink
[GWC-1293] Upgrade junit from 4.12 to 4.13.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sikeoka authored and aaime committed Jul 30, 2024
1 parent 3729e43 commit bd66f04
Show file tree
Hide file tree
Showing 60 changed files with 304 additions and 420 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package org.geowebcache.arcgis.layer;

import static org.geowebcache.util.TestUtils.isPresent;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasProperty;
import static org.junit.Assert.assertThat;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package org.geowebcache;

import static org.geowebcache.TestHelpers.hasStatus;
import static org.junit.Assert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;

import java.util.Collections;
import javax.servlet.http.HttpServletResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@
*/
package org.geowebcache;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.sameInstance;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertThrows;

import java.util.Collection;
import org.hamcrest.Matchers;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;

public class MockExtensionRuleTest {

@Rule public ExpectedException exception = ExpectedException.none();

@Test
public void testRestoresPreviousState() throws Throwable {
MockExtensionRule rule = new MockExtensionRule();
Expand Down Expand Up @@ -81,19 +79,24 @@ public void evaluate() throws Throwable {
public void testPropagatesException() throws Throwable {
MockExtensionRule rule = new MockExtensionRule();

exception.expectMessage("TEST EXCEPTION");
rule.apply(
new Statement() {

@Override
public void evaluate() throws Throwable {
String bean = "THISISTHEBEAN";
rule.addBean("foo", bean, String.class);
throw new RuntimeException("TEST EXCEPTION");
}
},
Description.createSuiteDescription("MOCK"))
.evaluate();
RuntimeException exception =
assertThrows(
RuntimeException.class,
() ->
rule.apply(
new Statement() {

@Override
public void evaluate() throws Throwable {
String bean = "THISISTHEBEAN";
rule.addBean("foo", bean, String.class);
throw new RuntimeException(
"TEST EXCEPTION");
}
},
Description.createSuiteDescription("MOCK"))
.evaluate());
assertThat(exception.getMessage(), containsString("TEST EXCEPTION"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
*/
package org.geowebcache.blobstore.file;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
Expand Down
Loading

0 comments on commit bd66f04

Please sign in to comment.