Skip to content

Commit a65a1ff

Browse files
committed
Use assertEquals and add LoggingLevelsTest
Replace assertFalse/assertTrue with assertEquals assertions that compare endpoint.isRunning() to stop()/start() results for clearer intent. Add import and annotate testStop with @LoggingLevelsTest(levels = "ERROR"). Remove unused static imports of assertFalse/assertTrue.
1 parent 81dcefd commit a65a1ff

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

microsphere-spring-cloud-commons/src/test/java/io/microsphere/spring/cloud/client/service/registry/endpoint/ServiceDeregistrationEndpointTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
package io.microsphere.spring.cloud.client.service.registry.endpoint;
1919

2020

21+
import io.microsphere.logging.test.jupiter.LoggingLevelsTest;
2122
import org.junit.jupiter.api.Test;
2223
import org.springframework.beans.factory.annotation.Autowired;
2324
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2425
import org.springframework.test.context.ContextConfiguration;
2526

26-
import static org.junit.jupiter.api.Assertions.assertFalse;
27-
import static org.junit.jupiter.api.Assertions.assertTrue;
27+
import static org.junit.jupiter.api.Assertions.assertEquals;
2828

2929
/**
3030
* {@link ServiceDeregistrationEndpoint} Test
@@ -47,9 +47,10 @@ class ServiceDeregistrationEndpointTest extends BaseServiceRegistrationEndpointT
4747
private ServiceDeregistrationEndpoint serviceDeregistrationEndpoint;
4848

4949
@Test
50+
@LoggingLevelsTest(levels = "ERROR")
5051
void testStop() {
51-
assertFalse(this.serviceDeregistrationEndpoint.stop());
52-
assertFalse(this.serviceRegistrationEndpoint.start());
53-
assertTrue(this.serviceDeregistrationEndpoint.stop());
52+
assertEquals(this.serviceDeregistrationEndpoint.isRunning(), this.serviceDeregistrationEndpoint.stop());
53+
assertEquals(this.serviceRegistrationEndpoint.isRunning(), this.serviceRegistrationEndpoint.start());
54+
assertEquals(this.serviceDeregistrationEndpoint.isRunning(), this.serviceDeregistrationEndpoint.stop());
5455
}
5556
}

0 commit comments

Comments
 (0)