Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2831,7 +2831,7 @@ public void supportsNumber() {
@Test
public void supportsNull() {
final FieldValue fieldValue = evaluateSingleFieldValue("toNumber(/notAField)", record);
assertEquals(null, fieldValue.getValue());
assertNull(fieldValue.getValue());
}
@Test
public void throwsExceptionOnUnsupportedType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class TestEventTypeValidator {
Expand All @@ -43,7 +44,7 @@ public void nullInputShouldProperlyFail() {
ValidationResult result = eventTypeValidator.validate(subject, input, context);

assertEquals("subject", result.getSubject());
assertEquals(null, result.getInput());
assertNull(result.getInput());
assertEquals("Empty event types are not allowed.", result.getExplanation());
assertFalse(result.isValid());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
import java.util.Map;
import java.util.Properties;

import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

class AmazonMSKConnectionServiceTest {

Expand Down Expand Up @@ -114,7 +114,7 @@ void testWebIdentityWithTokenProviderAddsProperty() throws InitializationExcepti
final Object provider = properties.get(AmazonMSKProperty.NIFI_AWS_MSK_CREDENTIALS_PROVIDER.getProperty());

assertNotNull(provider);
assertTrue(provider instanceof AwsCredentialsProvider);
assertInstanceOf(AwsCredentialsProvider.class, provider);
}

private static class MockOAuth2AccessTokenProvider extends AbstractControllerService implements OAuth2AccessTokenProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.HashMap;
import java.util.Map;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class PutGridFSIT extends GridFSITTestBase {
Expand Down Expand Up @@ -108,7 +109,7 @@ public void testNoUniqueness() {
Document query = Document.parse(String.format("{\"filename\": \"%s\"}", fileName));

long count = files.countDocuments(query);
assertTrue(count == 10, "Wrong count");
assertEquals(10, count, "Wrong count");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.anyInt;
Expand Down Expand Up @@ -448,7 +449,7 @@ public void testTemporarySuffixIsSetRenameIsCalled() throws IOException {
);

assertTrue(initialFilename.getValue().endsWith(suffix), "Suffix is not present and it should be");
assertTrue(!finalFilename.getValue().endsWith(suffix), "Suffix is present and it shouldn't be");
assertFalse(finalFilename.getValue().endsWith(suffix), "Suffix is present and it shouldn't be");
assertTrue(replace.getValue(), "Replace flag should be true");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import static org.apache.nifi.processors.snowflake.GetSnowflakeIngestStatus.REL_RETRY;
import static org.apache.nifi.processors.snowflake.GetSnowflakeIngestStatus.REL_SUCCESS;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
Expand Down Expand Up @@ -206,7 +207,7 @@ private void verifyTableContents() throws Exception {
assertTrue(resultSet.next(), "Expected row in test table");
assertEquals(1, resultSet.getInt("ID"));
assertEquals("foo", resultSet.getString("VALUE"));
assertTrue(!resultSet.next(), "Unexpected additional rows in test table");
assertFalse(resultSet.next(), "Unexpected additional rows in test table");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down Expand Up @@ -229,7 +230,7 @@ protected KubernetesClient getKubernetesClient() {

final IOException exception = assertThrows(IOException.class, () -> provider.setState(state, COMPONENT_ID));
assertEquals(String.format("Failed to update state for Component with ID [%s]", COMPONENT_ID), exception.getMessage());
assertTrue(exception.getCause() instanceof KubernetesClientException);
assertInstanceOf(KubernetesClientException.class, exception.getCause());
assertEquals(conflictException, exception.getCause());

verify(mockResource, atLeastOnce()).update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

class DtoFactoryBulletinStackTraceTest {

Expand All @@ -48,7 +49,7 @@ void testBulletinDtoDoesNotIncludeStackTraceByDefault() {
final BulletinDTO dto = dtoFactory.createBulletinDto(bulletin, false);

assertNotNull(dto);
assertEquals(null, dto.getStackTrace(), "DTO must not include stackTrace by default");
assertNull(dto.getStackTrace(), "DTO must not include stackTrace by default");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;

import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.lenient;
Expand Down Expand Up @@ -113,7 +113,7 @@ void testGetRootGroupAuthorizesReadAndReturnsWrappedFacade() {
final ProcessGroupFacade result = authorizingFlowContext.getRootGroup();

assertNotNull(result);
assertTrue(result instanceof AuthorizingProcessGroupFacade);
assertInstanceOf(AuthorizingProcessGroupFacade.class, result);
verify(connectorAuthorizable).authorize(any(Authorizer.class), any(RequestAction.class), any(NiFiUser.class));
}

Expand All @@ -124,7 +124,7 @@ void testGetParameterContextAuthorizesReadAndReturnsWrappedFacade() {
final ParameterContextFacade result = authorizingFlowContext.getParameterContext();

assertNotNull(result);
assertTrue(result instanceof AuthorizingParameterContextFacade);
assertInstanceOf(AuthorizingParameterContextFacade.class, result);
verify(connectorAuthorizable).authorize(any(Authorizer.class), any(RequestAction.class), any(NiFiUser.class));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

public class TestVersionedRemoteProcessGroup {

Expand All @@ -31,10 +32,10 @@ public void testGetTargetUriAndGetTargetUris() {
/* targetUri is null, targetUris varies */

vRPG.setTargetUris(null);
assertEquals(null, vRPG.getTargetUris());
assertNull(vRPG.getTargetUris());

vRPG.setTargetUris("");
assertEquals(null, vRPG.getTargetUris());
assertNull(vRPG.getTargetUris());

vRPG.setTargetUris("uri-2");
assertEquals("uri-2", vRPG.getTargetUris());
Expand All @@ -45,10 +46,10 @@ public void testGetTargetUriAndGetTargetUris() {
/* targetUri is empty, targetUris varies */

vRPG.setTargetUris(null);
assertEquals(null, vRPG.getTargetUris());
assertNull(vRPG.getTargetUris());

vRPG.setTargetUris("");
assertEquals(null, vRPG.getTargetUris());
assertNull(vRPG.getTargetUris());

vRPG.setTargetUris("uri-2");
assertEquals("uri-2", vRPG.getTargetUris());
Expand All @@ -59,10 +60,10 @@ public void testGetTargetUriAndGetTargetUris() {
/* targetUri is set, targetUris varies */

vRPG.setTargetUris(null);
assertEquals(null, vRPG.getTargetUris());
assertNull(vRPG.getTargetUris());

vRPG.setTargetUris("");
assertEquals(null, vRPG.getTargetUris());
assertNull(vRPG.getTargetUris());

vRPG.setTargetUris("uri-2");
assertEquals("uri-2", vRPG.getTargetUris());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

/**
Expand Down Expand Up @@ -104,8 +105,7 @@ public void testUploadFlowWithParameterProviderIncompatibleBundleVersion() throw
final ParameterProviderDTO providerDto = createdProvider.getComponent();
assertNotNull(providerDto);
assertNotNull(providerDto.getBundle(), "Bundle should not be null");
assertFalse(INCOMPATIBLE_VERSION.equals(providerDto.getBundle().getVersion()),
"Bundle version should NOT be the incompatible version - should have fallen back to available version");
assertNotEquals(INCOMPATIBLE_VERSION, providerDto.getBundle().getVersion(), "Bundle version should NOT be the incompatible version - should have fallen back to available version");
assertEquals(getNiFiVersion(), providerDto.getBundle().getVersion(),
"Bundle version should be the NiFi framework version (fallback)");
assertFalse(providerDto.getType().startsWith("(Missing)"),
Expand Down
Loading