Code cleanup (#1461)
* Code cleanup * Fix flux tests * Fix checkstyle errors * Fix compile error
This commit is contained in:
@ -32,8 +32,8 @@ Tenant class presents the clients of the API. CallsCount tracks the number of AP
|
||||
```java
|
||||
public class Tenant {
|
||||
|
||||
private String name;
|
||||
private int allowedCallsPerSecond;
|
||||
private final String name;
|
||||
private final int allowedCallsPerSecond;
|
||||
|
||||
public Tenant(String name, int allowedCallsPerSecond, CallsCount callsCount) {
|
||||
if (allowedCallsPerSecond < 0) {
|
||||
@ -56,7 +56,7 @@ public class Tenant {
|
||||
public final class CallsCount {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(CallsCount.class);
|
||||
private Map<String, AtomicLong> tenantCallsCount = new ConcurrentHashMap<>();
|
||||
private final Map<String, AtomicLong> tenantCallsCount = new ConcurrentHashMap<>();
|
||||
|
||||
public void addTenant(String tenantName) {
|
||||
tenantCallsCount.putIfAbsent(tenantName, new AtomicLong(0));
|
||||
|
@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
|
||||
public final class CallsCount {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(CallsCount.class);
|
||||
private Map<String, AtomicLong> tenantCallsCount = new ConcurrentHashMap<>();
|
||||
private final Map<String, AtomicLong> tenantCallsCount = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* Add a new tenant to the map.
|
||||
|
@ -30,8 +30,8 @@ import java.security.InvalidParameterException;
|
||||
*/
|
||||
public class Tenant {
|
||||
|
||||
private String name;
|
||||
private int allowedCallsPerSecond;
|
||||
private final String name;
|
||||
private final int allowedCallsPerSecond;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
|
||||
*/
|
||||
public class B2BServiceTest {
|
||||
|
||||
private CallsCount callsCount = new CallsCount();
|
||||
private final CallsCount callsCount = new CallsCount();
|
||||
|
||||
@Test
|
||||
public void dummyCustomerApiTest() {
|
||||
|
Reference in New Issue
Block a user