mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-28 00:26:03 +00:00
📍Use lombok, reformat, and optimize the code (#1560)
* Use lombok, reformat, and optimize the code * Fix merge conflicts and some sonar issues Co-authored-by: va1m <va1m@email.com>
This commit is contained in:
+3
-4
@@ -35,7 +35,7 @@ public class DefaultCircuitBreakerTest {
|
||||
|
||||
//long timeout, int failureThreshold, long retryTimePeriod
|
||||
@Test
|
||||
public void testEvaluateState() {
|
||||
void testEvaluateState() {
|
||||
var circuitBreaker = new DefaultCircuitBreaker(null, 1, 1, 100);
|
||||
//Right now, failureCount<failureThreshold, so state should be closed
|
||||
assertEquals(circuitBreaker.getState(), "CLOSED");
|
||||
@@ -57,7 +57,7 @@ public class DefaultCircuitBreakerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetStateForBypass() {
|
||||
void testSetStateForBypass() {
|
||||
var circuitBreaker = new DefaultCircuitBreaker(null, 1, 1, 2000 * 1000 * 1000);
|
||||
//Right now, failureCount<failureThreshold, so state should be closed
|
||||
//Bypass it and set it to open
|
||||
@@ -66,7 +66,7 @@ public class DefaultCircuitBreakerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApiResponses() throws RemoteServiceException {
|
||||
void testApiResponses() throws RemoteServiceException {
|
||||
RemoteService mockService = new RemoteService() {
|
||||
@Override
|
||||
public String call() throws RemoteServiceException {
|
||||
@@ -79,6 +79,5 @@ public class DefaultCircuitBreakerTest {
|
||||
var serviceStartTime = System.nanoTime() - 60 * 1000 * 1000 * 1000;
|
||||
var response = circuitBreaker.attemptRequest();
|
||||
assertEquals(response, "Remote Success");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user