[Minor] Replaced deprecated junit calls
This commit is contained in:
parent
86794367eb
commit
ab1044c446
|
@ -16,8 +16,8 @@
|
||||||
package li.strolch.command;
|
package li.strolch.command;
|
||||||
|
|
||||||
import static li.strolch.service.test.AbstractRealmServiceTest.*;
|
import static li.strolch.service.test.AbstractRealmServiceTest.*;
|
||||||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.hamcrest.Matchers.containsString;
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
package li.strolch.service;
|
package li.strolch.service;
|
||||||
|
|
||||||
import static li.strolch.testbase.runtime.RuntimeMock.assertServiceResult;
|
import static li.strolch.testbase.runtime.RuntimeMock.assertServiceResult;
|
||||||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.hamcrest.Matchers.containsString;
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
*/
|
*/
|
||||||
package li.strolch.service.test;
|
package li.strolch.service.test;
|
||||||
|
|
||||||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.hamcrest.Matchers.containsString;
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
|
|
||||||
import li.strolch.privilege.model.Certificate;
|
import li.strolch.privilege.model.Certificate;
|
||||||
import li.strolch.service.test.model.GreetingResult;
|
import li.strolch.service.test.model.GreetingResult;
|
||||||
|
|
|
@ -15,8 +15,9 @@
|
||||||
*/
|
*/
|
||||||
package li.strolch.service.test;
|
package li.strolch.service.test;
|
||||||
|
|
||||||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThrows;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.HashSet;
|
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;
|
||||||
import li.strolch.service.test.model.GreetingService.GreetingArgument;
|
import li.strolch.service.test.model.GreetingService.GreetingArgument;
|
||||||
import li.strolch.service.test.model.TestService;
|
import li.strolch.service.test.model.TestService;
|
||||||
import org.junit.Rule;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.ExpectedException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||||
*/
|
*/
|
||||||
public class ServiceTest extends AbstractServiceTest {
|
public class ServiceTest extends AbstractServiceTest {
|
||||||
|
|
||||||
@Rule
|
|
||||||
public ExpectedException thrown = ExpectedException.none();
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldFailInvalidCertificate1() {
|
public void shouldFailInvalidCertificate1() {
|
||||||
this.thrown.expect(PrivilegeException.class);
|
assertThrows(PrivilegeException.class, () -> {
|
||||||
TestService testService = new TestService();
|
TestService testService = new TestService();
|
||||||
getServiceHandler().doService(
|
getServiceHandler().doService(
|
||||||
new Certificate(null, null, null, null, null, null, null, null, LocalDateTime.now(), false, null,
|
new Certificate(null, null, null, null, null, null, null, null, LocalDateTime.now(), false, null,
|
||||||
new HashSet<>(), null), testService);
|
new HashSet<>(), null), testService);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -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.RES_ID;
|
||||||
import static li.strolch.xmlpers.test.model.ModelBuilder.createResource;
|
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.containsInAnyOrder;
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.hamcrest.Matchers.containsString;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
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.Book;
|
||||||
import li.strolch.xmlpers.test.model.MyModel;
|
import li.strolch.xmlpers.test.model.MyModel;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.ExpectedException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||||
*/
|
*/
|
||||||
public class TransactionResultTest extends AbstractPersistenceTest {
|
public class TransactionResultTest extends AbstractPersistenceTest {
|
||||||
|
|
||||||
@Rule
|
|
||||||
public ExpectedException thrown = ExpectedException.none();
|
|
||||||
|
|
||||||
private static final String BASEPATH = "target/db/TxResultTest/"; //$NON-NLS-1$
|
private static final String BASEPATH = "target/db/TxResultTest/"; //$NON-NLS-1$
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
|
Loading…
Reference in New Issue