Skip to content

Commit

Permalink
[eclipse-hono#5] Conform CheckStyle rules (final keyword + license he…
Browse files Browse the repository at this point in the history
…aders + static imports).

Signed-off-by: Abel Buechner-Mihaljevic <[email protected]>
  • Loading branch information
b-abel committed Aug 24, 2020
1 parent 917da6e commit 48740b1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
package org.eclipse.hono.gateway.sdk.mqtt2amqp;

import static org.assertj.core.api.Assertions.assertThat;
import static org.eclipse.hono.gateway.sdk.mqtt2amqp.TestMqttProtocolGateway.GW_PASSWORD;
import static org.eclipse.hono.gateway.sdk.mqtt2amqp.TestMqttProtocolGateway.GW_USERNAME;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
Expand Down Expand Up @@ -465,16 +463,16 @@ public void testConnectWithGatewayCredentialsResolvedDynamicallySucceeds() {
// WHEN the gateway connects
connectTestDevice(gateway);

ArgumentCaptor<ClientConfigProperties> configPropertiesArgumentCaptor = ArgumentCaptor
final ArgumentCaptor<ClientConfigProperties> configPropertiesArgumentCaptor = ArgumentCaptor
.forClass(ClientConfigProperties.class);

verify(tenantConnectionManager).connect(anyString(), any(), configPropertiesArgumentCaptor.capture());

final ClientConfigProperties clientConfig = configPropertiesArgumentCaptor.getValue();

// THEN the AMQP connection is authenticated with the provided credentials...
assertThat(clientConfig.getUsername()).isEqualTo(GW_USERNAME);
assertThat(clientConfig.getPassword()).isEqualTo(GW_PASSWORD);
assertThat(clientConfig.getUsername()).isEqualTo(TestMqttProtocolGateway.GW_USERNAME);
assertThat(clientConfig.getPassword()).isEqualTo(TestMqttProtocolGateway.GW_PASSWORD);

// ... and not with the credentials from the configuration
assertThat(clientConfig.getUsername()).isNotEqualTo(configWithoutCredentials.getUsername());
Expand Down Expand Up @@ -503,7 +501,7 @@ public void testConfiguredCredentialsTakePrecedenceOverImplementation() {
// WHEN the gateway connects
connectTestDevice(gateway);

ArgumentCaptor<ClientConfigProperties> configPropertiesArgumentCaptor = ArgumentCaptor
final ArgumentCaptor<ClientConfigProperties> configPropertiesArgumentCaptor = ArgumentCaptor
.forClass(ClientConfigProperties.class);

verify(tenantConnectionManager).connect(anyString(), any(), configPropertiesArgumentCaptor.capture());
Expand All @@ -515,8 +513,8 @@ public void testConfiguredCredentialsTakePrecedenceOverImplementation() {
assertThat(clientConfig.getPassword()).isEqualTo(password);

// ... and not with the credentials from the implementation
assertThat(clientConfig.getUsername()).isNotEqualTo(GW_USERNAME);
assertThat(clientConfig.getPassword()).isNotEqualTo(GW_PASSWORD);
assertThat(clientConfig.getUsername()).isNotEqualTo(TestMqttProtocolGateway.GW_USERNAME);
assertThat(clientConfig.getPassword()).isNotEqualTo(TestMqttProtocolGateway.GW_PASSWORD);
}

/**
Expand Down Expand Up @@ -611,7 +609,7 @@ private void rejectAmqpMessage() {

verify(protonSender).send(any(), handlerArgumentCaptor.capture());

ProtonDelivery protonDelivery = mock(ProtonDelivery.class);
final ProtonDelivery protonDelivery = mock(ProtonDelivery.class);
when(protonDelivery.getRemoteState()).thenReturn(new Rejected());
when(protonDelivery.remotelySettled()).thenReturn(true);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*******************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/

package org.eclipse.hono.gateway.sdk.mqtt2amqp;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*******************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/

package org.eclipse.hono.gateway.sdk.mqtt2amqp;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down

0 comments on commit 48740b1

Please sign in to comment.