47
47
import org .openhab .binding .bluetooth .discovery .BluetoothDiscoveryDevice ;
48
48
import org .openhab .binding .bluetooth .discovery .BluetoothDiscoveryParticipant ;
49
49
import org .openhab .binding .bluetooth .notification .BluetoothConnectionStatusNotification ;
50
- import org .openhab .binding .bluetooth .util .StringUtil ;
51
50
import org .openhab .core .config .discovery .DiscoveryListener ;
52
51
import org .openhab .core .config .discovery .DiscoveryResult ;
53
52
import org .openhab .core .config .discovery .DiscoveryResultBuilder ;
54
53
import org .openhab .core .thing .ThingTypeUID ;
55
54
import org .openhab .core .thing .ThingUID ;
55
+ import org .openhab .core .util .StringUtils ;
56
56
57
57
/**
58
58
* Tests {@link BluetoothDiscoveryService}.
@@ -196,7 +196,7 @@ public void connectionParticipantTest() {
196
196
197
197
MockBluetoothAdapter mockAdapter1 = new MockBluetoothAdapter ();
198
198
MockBluetoothDevice mockDevice = mockAdapter1 .getDevice (address );
199
- String deviceName = StringUtil . randomAlphanummeric (10 );
199
+ String deviceName = StringUtils . getRandomAlphanumeric (10 );
200
200
mockDevice .setDeviceName (deviceName );
201
201
202
202
BluetoothDevice device = Mockito .spy (mockDevice );
@@ -223,7 +223,7 @@ public void multiDiscoverySingleConnectionTest() {
223
223
MockBluetoothAdapter mockAdapter2 = new MockBluetoothAdapter ();
224
224
MockBluetoothDevice mockDevice1 = mockAdapter1 .getDevice (address );
225
225
MockBluetoothDevice mockDevice2 = mockAdapter2 .getDevice (address );
226
- String deviceName = StringUtil . randomAlphanummeric (10 );
226
+ String deviceName = StringUtils . getRandomAlphanumeric (10 );
227
227
mockDevice1 .setDeviceName (deviceName );
228
228
mockDevice2 .setDeviceName (deviceName );
229
229
@@ -261,7 +261,7 @@ public void multiDiscoverySingleConnectionTest() {
261
261
public void nonConnectionParticipantTest () {
262
262
MockBluetoothAdapter mockAdapter1 = new MockBluetoothAdapter ();
263
263
MockBluetoothDevice mockDevice = mockAdapter1 .getDevice (TestUtils .randomAddress ());
264
- String deviceName = StringUtil . randomAlphanummeric (10 );
264
+ String deviceName = StringUtils . getRandomAlphanumeric (10 );
265
265
mockDevice .setDeviceName (deviceName );
266
266
267
267
BluetoothDevice device = Mockito .spy (mockDevice );
@@ -418,7 +418,7 @@ public void recursiveFutureTest() throws InterruptedException {
418
418
MockBluetoothAdapter mockAdapter2 = new MockBluetoothAdapter ();
419
419
MockBluetoothDevice mockDevice1 = mockAdapter1 .getDevice (address );
420
420
MockBluetoothDevice mockDevice2 = mockAdapter2 .getDevice (address );
421
- String deviceName = StringUtil . randomAlphanummeric (10 );
421
+ String deviceName = StringUtils . getRandomAlphanumeric (10 );
422
422
423
423
MockDiscoveryParticipant participant2 = new MockDiscoveryParticipant () {
424
424
@ Override
@@ -534,7 +534,7 @@ private class MockDiscoveryParticipant implements BluetoothDiscoveryParticipant
534
534
private ThingTypeUID typeUID ;
535
535
536
536
public MockDiscoveryParticipant () {
537
- this .typeUID = new ThingTypeUID (BluetoothBindingConstants .BINDING_ID , StringUtil . randomAlphabetic (6 ));
537
+ this .typeUID = new ThingTypeUID (BluetoothBindingConstants .BINDING_ID , StringUtils . getRandomAlphabetic (6 ));
538
538
}
539
539
540
540
@ Override
@@ -544,20 +544,20 @@ public Set<ThingTypeUID> getSupportedThingTypeUIDs() {
544
544
545
545
@ Override
546
546
public @ Nullable DiscoveryResult createResult (BluetoothDiscoveryDevice device ) {
547
- String repProp = StringUtil . randomAlphabetic (6 );
547
+ String repProp = StringUtils . getRandomAlphabetic (6 );
548
548
ThingUID thingUID = getThingUID (device );
549
549
if (thingUID == null ) {
550
550
return null ;
551
551
}
552
- return DiscoveryResultBuilder .create (thingUID ).withLabel (StringUtil . randomAlphabetic (6 ))
553
- .withProperty (repProp , StringUtil . randomAlphabetic (6 )).withRepresentationProperty (repProp )
552
+ return DiscoveryResultBuilder .create (thingUID ).withLabel (StringUtils . getRandomAlphabetic (6 ))
553
+ .withProperty (repProp , StringUtils . getRandomAlphabetic (6 )).withRepresentationProperty (repProp )
554
554
.withBridge (device .getAdapter ().getUID ()).build ();
555
555
}
556
556
557
557
@ Override
558
558
public @ Nullable ThingUID getThingUID (BluetoothDiscoveryDevice device ) {
559
559
String deviceName = device .getName ();
560
- String id = deviceName != null ? deviceName : StringUtil . randomAlphabetic (6 );
560
+ String id = deviceName != null ? deviceName : StringUtils . getRandomAlphabetic (6 );
561
561
return new ThingUID (typeUID , device .getAdapter ().getUID (), id );
562
562
}
563
563
}
0 commit comments