Migrate to JUnit5

This commit is contained in:
Artur Mogozov
2017-12-31 16:29:48 +09:00
parent a20e54d0a7
commit 6694d742a3
408 changed files with 2656 additions and 2165 deletions

View File

@ -22,7 +22,7 @@
*/
package com.iluwatar.throttling;
import org.junit.Test;
import org.junit.jupiter.api.Test;
/**
* Application test

View File

@ -22,11 +22,11 @@
*/
package com.iluwatar.throttling;
import org.junit.Assert;
import org.junit.Test;
import com.iluwatar.throttling.timer.ThrottleTimerImpl;
import com.iluwatar.throttling.timer.Throttler;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* B2BServiceTest class to test the B2BService
@ -43,6 +43,6 @@ public class B2BServiceTest {
service.dummyCustomerApi(tenant);
}
long counter = CallsCount.getCount(tenant.getName());
Assert.assertTrue("Counter limit must be reached", counter == 2);
assertTrue(counter == 2, "Counter limit must be reached");
}
}

View File

@ -22,19 +22,21 @@
*/
package com.iluwatar.throttling;
import org.junit.Test;
import com.iluwatar.throttling.Tenant;
import org.junit.jupiter.api.Test;
import java.security.InvalidParameterException;
import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* TenantTest to test the creation of Tenant with valid parameters.
*/
public class TenantTest {
@Test(expected = InvalidParameterException.class)
@Test
public void constructorTest() {
Tenant tenant = new Tenant("FailTenant", -1);
assertThrows(InvalidParameterException.class, () -> {
Tenant tenant = new Tenant("FailTenant", -1);
});
}
}