[Minor] Replaced deprecated junit calls

This commit is contained in:
Robert von Burg 2020-08-19 10:33:47 +02:00
parent 86794367eb
commit ab1044c446
5 changed files with 12 additions and 20 deletions

View File

@ -16,8 +16,8 @@
package li.strolch.command;
import static li.strolch.service.test.AbstractRealmServiceTest.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.io.File;

View File

@ -16,8 +16,8 @@
package li.strolch.service;
import static li.strolch.testbase.runtime.RuntimeMock.assertServiceResult;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;
import java.io.File;
import java.io.IOException;

View File

@ -15,8 +15,8 @@
*/
package li.strolch.service.test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;
import li.strolch.privilege.model.Certificate;
import li.strolch.service.test.model.GreetingResult;

View File

@ -15,8 +15,9 @@
*/
package li.strolch.service.test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertThrows;
import java.time.LocalDateTime;
import java.util.HashSet;
@ -32,25 +33,21 @@ import li.strolch.service.test.model.GreetingResult;
import li.strolch.service.test.model.GreetingService;
import li.strolch.service.test.model.GreetingService.GreetingArgument;
import li.strolch.service.test.model.TestService;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*/
public class ServiceTest extends AbstractServiceTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Test
public void shouldFailInvalidCertificate1() {
this.thrown.expect(PrivilegeException.class);
TestService testService = new TestService();
getServiceHandler().doService(
new Certificate(null, null, null, null, null, null, null, null, LocalDateTime.now(), false, null,
new HashSet<>(), null), testService);
assertThrows(PrivilegeException.class, () -> {
TestService testService = new TestService();
getServiceHandler().doService(
new Certificate(null, null, null, null, null, null, null, null, LocalDateTime.now(), false, null,
new HashSet<>(), null), testService);
});
}
@Test

View File

@ -17,10 +17,10 @@ package li.strolch.xmlpers.test;
import static li.strolch.xmlpers.test.model.ModelBuilder.RES_ID;
import static li.strolch.xmlpers.test.model.ModelBuilder.createResource;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import java.util.ArrayList;
import java.util.List;
@ -30,18 +30,13 @@ import li.strolch.xmlpers.api.*;
import li.strolch.xmlpers.test.model.Book;
import li.strolch.xmlpers.test.model.MyModel;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*/
public class TransactionResultTest extends AbstractPersistenceTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
private static final String BASEPATH = "target/db/TxResultTest/"; //$NON-NLS-1$
@Before