Code cleanup (#1461)

* Code cleanup

* Fix flux tests

* Fix checkstyle errors

* Fix compile error
This commit is contained in:
Ilkka Seppälä
2020-07-30 20:28:47 +03:00
committed by GitHub
parent 5381387026
commit 417f21ed3d
243 changed files with 1154 additions and 1162 deletions

View File

@ -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));

View File

@ -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.

View File

@ -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.

View File

@ -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() {