Skip to content

Commit

Permalink
Remove obsolete RegistrationConstants.ACTION_GET constant.
Browse files Browse the repository at this point in the history
Signed-off-by: Carsten Lohmann <[email protected]>
  • Loading branch information
calohmn committed Nov 13, 2020
1 parent c6a88fd commit 3eb2a7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ public final class RegistrationConstants extends RequestResponseApiConstants {
/**
* The AMQP 1.0 <em>subject</em> to use for the <em>assert device registration</em> operation.
*/
public static final String ACTION_ASSERT = "assert";
/**
* The AMQP 1.0 <em>subject</em> to use for the <em>get registration information</em> operation.
*/
public static final String ACTION_GET = "get";
public static final String ACTION_ASSERT = "assert";

/**
* The name of the field in a response to the <em>get registration information</em> operation
* that contains a device's registration information.
* The name of the field containing a device's registration information.
* May be used when getting registration data in order to create the
* response to the <em>assert device registration</em> operation (which
* won't contain such a field though).
*/
public static final String FIELD_DATA = "data";
public static final String FIELD_DATA = "data";

/**
* The name of the field in a response to the <em>assert Device Registration</em> operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class RegistrationMessageFilterTest {
@Test
public void testVerifyDetectsDeviceIdMismatch() {
// GIVEN a registration message with device id not matching the link target
final Message msg = givenAMessageHavingProperties(MY_DEVICE + "_1", RegistrationConstants.ACTION_GET);
final Message msg = givenAMessageHavingProperties(MY_DEVICE + "_1", RegistrationConstants.ACTION_ASSERT);

// WHEN receiving the message via a link
final ResourceIdentifier linkTarget = getResourceIdentifier(MY_TENANT, MY_DEVICE);
Expand All @@ -54,7 +54,7 @@ public void testVerifyDetectsDeviceIdMismatch() {
@Test
public void testVerifyDetectsMissingDeviceId() {
// GIVEN a registration message lacking the device id
final Message msg = givenAMessageHavingProperties(null, RegistrationConstants.ACTION_GET);
final Message msg = givenAMessageHavingProperties(null, RegistrationConstants.ACTION_ASSERT);

// WHEN receiving the message via a link
final ResourceIdentifier linkTarget = getResourceIdentifier(MY_TENANT);
Expand Down Expand Up @@ -86,7 +86,7 @@ public void testVerifyDetectsMissingAction() {
@Test
public void testVerifySucceedsForTenantOnlyLinkTarget() {
// GIVEN a valid registration message for myDevice
final Message msg = givenAMessageHavingProperties(MY_DEVICE, RegistrationConstants.ACTION_GET);
final Message msg = givenAMessageHavingProperties(MY_DEVICE, RegistrationConstants.ACTION_ASSERT);

// WHEN receiving the message via a link with matching tenant-level target address
final ResourceIdentifier linkTarget = getResourceIdentifier(MY_TENANT);
Expand All @@ -102,7 +102,7 @@ public void testVerifySucceedsForTenantOnlyLinkTarget() {
@Test
public void testVerifySucceedsForMatchingDevice() {
// GIVEN a registration message for myDevice
final Message msg = givenAMessageHavingProperties(MY_DEVICE, RegistrationConstants.ACTION_GET);
final Message msg = givenAMessageHavingProperties(MY_DEVICE, RegistrationConstants.ACTION_ASSERT);

// WHEN receiving the message via a link with matching device-level address
final ResourceIdentifier linkTarget = getResourceIdentifier(MY_TENANT, MY_DEVICE);
Expand Down

0 comments on commit 3eb2a7e

Please sign in to comment.