Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GWC-1293] Upgrade junit from 4.12 to 4.13.2 #1294

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading