minor changes

This commit is contained in:
Ganesh Pagade 2018-10-22 19:11:40 +05:30
parent e9bc235b1c
commit 87153bd9ff
2 changed files with 5 additions and 3 deletions

View File

@ -11,7 +11,7 @@ zuul:
repository: JPA repository: JPA
policy-list: policy-list:
serviceSimple: serviceSimple:
- limit: 1 - limit: 5
refresh-interval: 60 refresh-interval: 60
type: type:
- origin - origin

View File

@ -35,7 +35,7 @@ public class GreetingControllerTest {
private TestRestTemplate restTemplate; private TestRestTemplate restTemplate;
@Test @Test
public void testNotExceedingCapacityRequest() { public void whenRequestNotExceedingCapacity_thenReturnOkResponse() {
ResponseEntity<String> response = this.restTemplate.getForEntity(SIMPLE_GREETING, String.class); ResponseEntity<String> response = this.restTemplate.getForEntity(SIMPLE_GREETING, String.class);
HttpHeaders headers = response.getHeaders(); HttpHeaders headers = response.getHeaders();
String key = "rate-limit-application_serviceSimple_127.0.0.1"; String key = "rate-limit-application_serviceSimple_127.0.0.1";
@ -44,7 +44,7 @@ public class GreetingControllerTest {
} }
@Test @Test
public void testExceedingCapacity() throws InterruptedException { public void whenRequestExceedingCapacity_thenReturnTooManyRequestsResponse() throws InterruptedException {
ResponseEntity<String> response = this.restTemplate ResponseEntity<String> response = this.restTemplate
.getForEntity(ADVANCED_GREETING, String.class); .getForEntity(ADVANCED_GREETING, String.class);
HttpHeaders headers = response.getHeaders(); HttpHeaders headers = response.getHeaders();
@ -95,4 +95,6 @@ public class GreetingControllerTest {
assertNotNull(reset); assertNotNull(reset);
} }
} }
} }