Fix new line after @Test (#2486)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-06-20 17:42:55 +03:00
committed by GitHub
parent cb7f1107fe
commit ef25aa59f0
152 changed files with 2948 additions and 1474 deletions

View File

@@ -63,7 +63,8 @@ class GatewayTokenAuthenticatorTest {
/**
* Tests successful authentication with gateway token
*/
@Test void testWithGwToken() {
@Test
void testWithGwToken() {
final ControllerSecurityToken securityToken = prepareSecurityToken(GATEWAY_TOKEN);
when(tenantConfigurationManagementMock.getConfigurationValue(
TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY, String.class))
@@ -80,7 +81,8 @@ class GatewayTokenAuthenticatorTest {
/**
* Tests that if gateway token doesn't match, the authentication fails
*/
@Test void testWithBadGwToken() {
@Test
void testWithBadGwToken() {
final ControllerSecurityToken securityToken = prepareSecurityToken(UNKNOWN_TOKEN);
when(tenantConfigurationManagementMock.getConfigurationValue(
TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY, String.class))
@@ -95,14 +97,16 @@ class GatewayTokenAuthenticatorTest {
/**
* Tests that if gateway token miss, the authentication fails
*/
@Test void testWithoutGwToken() {
@Test
void testWithoutGwToken() {
assertThat(authenticator.authenticate(new ControllerSecurityToken("DEFAULT", CONTROLLER_ID))).isNull();
}
/**
* Tests that if disabled, the authentication fails
*/
@Test void testWithGwTokenButDisabled() {
@Test
void testWithGwTokenButDisabled() {
final ControllerSecurityToken securityToken = prepareSecurityToken(GATEWAY_TOKEN);
when(tenantConfigurationManagementMock.getConfigurationValue(
TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_ENABLED, Boolean.class))

View File

@@ -74,7 +74,8 @@ class SecurityHeaderAuthenticatorTest {
/**
* Tests successful authentication with multiple a single hashes
*/
@Test void testWithSingleKnownHash() {
@Test
void testWithSingleKnownHash() {
final ControllerSecurityToken securityToken = prepareSecurityToken(SINGLE_HASH);
when(tenantConfigurationManagementMock.getConfigurationValue(
TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME, String.class))
@@ -91,7 +92,8 @@ class SecurityHeaderAuthenticatorTest {
/**
* Tests successful authentication with multiple hashes
*/
@Test void testWithMultipleKnownHashes() {
@Test
void testWithMultipleKnownHashes() {
when(tenantConfigurationManagementMock.getConfigurationValue(
TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME, String.class))
.thenReturn(CONFIG_VALUE_MULTI_HASH);
@@ -113,7 +115,8 @@ class SecurityHeaderAuthenticatorTest {
/**
* Tests that if the hash is unknown, the authentication fails
*/
@Test void testWithUnknownHash() {
@Test
void testWithUnknownHash() {
final ControllerSecurityToken securityToken = prepareSecurityToken(UNKNOWN_HASH);
when(tenantConfigurationManagementMock.getConfigurationValue(
TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME, String.class))
@@ -128,7 +131,8 @@ class SecurityHeaderAuthenticatorTest {
/**
* Tests that if CN doesn't match the CN in the security token, the authentication fails
*/
@Test void testWithNonMatchingCN() {
@Test
void testWithNonMatchingCN() {
final ControllerSecurityToken securityToken = new ControllerSecurityToken("DEFAULT", "otherControllerID");
securityToken.putHeader(CA_COMMON_NAME, CA_COMMON_NAME_VALUE);
securityToken.putHeader(X_SSL_ISSUER_HASH_1, SINGLE_HASH);
@@ -139,14 +143,16 @@ class SecurityHeaderAuthenticatorTest {
/**
* Tests that if the hash miss, the authentication fails
*/
@Test void testWithoutHash() {
@Test
void testWithoutHash() {
assertThat(authenticator.authenticate(new ControllerSecurityToken("DEFAULT", CA_COMMON_NAME_VALUE))).isNull();
}
/**
* Tests that if disabled, the authentication fails
*/
@Test void testWithSingleKnownHashButDisabled() {
@Test
void testWithSingleKnownHashButDisabled() {
final ControllerSecurityToken securityToken = prepareSecurityToken(SINGLE_HASH);
when(tenantConfigurationManagementMock.getConfigurationValue(
TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_ENABLED, Boolean.class))

View File

@@ -68,7 +68,8 @@ class SecurityTokenAuthenticatorTest {
/**
* Tests successful authentication with gateway token
*/
@Test void testWithSecToken() {
@Test
void testWithSecToken() {
final ControllerSecurityToken securityToken = prepareSecurityToken(SECURITY_TOKEN);
when(tenantConfigurationManagementMock.getConfigurationValue(
TenantConfigurationKey.AUTHENTICATION_MODE_TARGET_SECURITY_TOKEN_ENABLED, Boolean.class))
@@ -87,7 +88,8 @@ class SecurityTokenAuthenticatorTest {
/**
* Tests that if gateway token doesn't match, the authentication fails
*/
@Test void testWithBadSecToken() {
@Test
void testWithBadSecToken() {
final ControllerSecurityToken securityToken = prepareSecurityToken(UNKNOWN_TOKEN);
when(tenantConfigurationManagementMock.getConfigurationValue(
TenantConfigurationKey.AUTHENTICATION_MODE_TARGET_SECURITY_TOKEN_ENABLED, Boolean.class))
@@ -99,14 +101,16 @@ class SecurityTokenAuthenticatorTest {
/**
* Tests that if gateway token miss, the authentication fails
*/
@Test void testWithoutSecToken() {
@Test
void testWithoutSecToken() {
assertThat(authenticator.authenticate(new ControllerSecurityToken("DEFAULT", CONTROLLER_ID))).isNull();
}
/**
* Tests that if disabled, the authentication fails
*/
@Test void testWithSecTokenButDisabled() {
@Test
void testWithSecTokenButDisabled() {
final ControllerSecurityToken securityToken = prepareSecurityToken(SECURITY_TOKEN);
when(tenantConfigurationManagementMock.getConfigurationValue(
TenantConfigurationKey.AUTHENTICATION_MODE_TARGET_SECURITY_TOKEN_ENABLED, Boolean.class))