This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ursula Walenciak
committed
May 22, 2017
1 parent
cb6505b
commit e0e7a42
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/test/java/com/telekom/m2m/cot/restsdk/devicecontrol/DeviceCredentialsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.telekom.m2m.cot.restsdk.devicecontrol; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertNotNull; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
public class DeviceCredentialsTest { | ||
|
||
@Test | ||
public void testToString() { | ||
|
||
final DeviceCredentials deviceCredentials = new DeviceCredentials(); | ||
|
||
deviceCredentials.setId("id_" + System.currentTimeMillis()); | ||
deviceCredentials.setUsername("username_" + System.currentTimeMillis()); | ||
deviceCredentials.setPassword("password_" + System.currentTimeMillis()); | ||
deviceCredentials.setTenantId("tenantId_" + System.currentTimeMillis()); | ||
|
||
final String stringRepresentation = deviceCredentials.toString(); | ||
assertNotNull(stringRepresentation); | ||
assertFalse(stringRepresentation.contains(deviceCredentials.getPassword())); | ||
assertTrue(stringRepresentation.contains(deviceCredentials.getId())); | ||
assertTrue(stringRepresentation.contains(deviceCredentials.getUsername())); | ||
assertTrue(stringRepresentation.contains(deviceCredentials.getTenantId())); | ||
} | ||
|
||
} |