forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[freebox] Hot fix for login to the freebox (openhab#7696)
* [freebox] Hot fix for login to the freebox PR openhab#7460 broke the freebox binding * Unit test added for method hmacSha1 Signed-off-by: Laurent Garnier <[email protected]>
- Loading branch information
Showing
3 changed files
with
36 additions
and
4 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
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
33 changes: 33 additions & 0 deletions
33
...freebox/src/test/java/org/openhab/binding/freebox/internal/api/FreeboxApiManagerTest.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,33 @@ | ||
/** | ||
* Copyright (c) 2010-2020 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* 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.openhab.binding.freebox.internal.api; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* | ||
* @author Laurent Garnier - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class FreeboxApiManagerTest { | ||
|
||
@Test | ||
public void hmacSha1Test() throws Exception { | ||
String expected = "25dad1bb5604321f12b755cc9d755d1480cf7989"; | ||
String actual = FreeboxApiManager.hmacSha1("Token1234", "Challenge"); | ||
Assert.assertEquals(expected, actual); | ||
} | ||
|
||
} |