Sonar Fixes (6) (#2214)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -196,7 +196,7 @@ public final class FileStreamingUtil {
|
||||
|
||||
private static long sublong(final String value, final int beginIndex, final int endIndex) {
|
||||
final String substring = value.substring(beginIndex, endIndex);
|
||||
return substring.length() > 0 ? Long.parseLong(substring) : -1;
|
||||
return substring.isEmpty() ? -1 : Long.parseLong(substring);
|
||||
}
|
||||
|
||||
private static void checkForShortcut(final HttpServletRequest request, final String etag, final long lastModified,
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
|
||||
@Feature("Unit Tests - Security")
|
||||
@Story("Exclude path aware shallow ETag filter")
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class ExcludePathAwareShallowETagFilterTest {
|
||||
class ExcludePathAwareShallowETagFilterTest {
|
||||
|
||||
@Mock
|
||||
private HttpServletRequest servletRequestMock;
|
||||
@@ -46,7 +46,7 @@ public class ExcludePathAwareShallowETagFilterTest {
|
||||
private FilterChain filterChainMock;
|
||||
|
||||
@Test
|
||||
public void excludePathDoesNotCalculateETag() throws ServletException, IOException {
|
||||
void excludePathDoesNotCalculateETag() throws ServletException, IOException {
|
||||
final String knownContextPath = "/bumlux/test";
|
||||
final String knownUri = knownContextPath + "/exclude/download";
|
||||
final String antPathExclusion = "/exclude/**";
|
||||
@@ -68,7 +68,7 @@ public class ExcludePathAwareShallowETagFilterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pathNotExcludedETagIsCalculated() throws ServletException, IOException {
|
||||
void pathNotExcludedETagIsCalculated() throws ServletException, IOException {
|
||||
final String knownContextPath = "/bumlux/test";
|
||||
final String knownUri = knownContextPath + "/include/download";
|
||||
final String antPathExclusion = "/exclude/**";
|
||||
|
||||
@@ -21,11 +21,11 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
@Feature("Unit Tests - Management API")
|
||||
@Story("Error Handling")
|
||||
public class ExceptionInfoTest {
|
||||
class ExceptionInfoTest {
|
||||
|
||||
@Test
|
||||
@Description("Ensures that setters and getters match on teh payload.")
|
||||
public void setterAndGetterOnExceptionInfo() {
|
||||
void setterAndGetterOnExceptionInfo() {
|
||||
final String knownExceptionClass = "hawkbit.test.exception.Class";
|
||||
final String knownErrorCode = "hawkbit.error.code.Known";
|
||||
final String knownMessage = "a known message";
|
||||
|
||||
@@ -40,8 +40,8 @@ import org.springframework.http.ResponseEntity;
|
||||
@Story("File streaming")
|
||||
class FileStreamingUtilTest {
|
||||
|
||||
private final static String CONTENT = "This is some very long string which is intended to test";
|
||||
private final static byte[] CONTENT_BYTES = CONTENT.getBytes(StandardCharsets.UTF_8);
|
||||
private static final String CONTENT = "This is some very long string which is intended to test";
|
||||
private static final byte[] CONTENT_BYTES = CONTENT.getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
private static final DbArtifact TEST_ARTIFACT = new DbArtifact() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user