Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[freebox] Hot fix for login to the freebox #7696

Merged
merged 3 commits into from
May 20, 2020

Conversation

lolodomo
Copy link
Contributor

PR #7460 broke the freebox binding

Signed-off-by: Laurent Garnier [email protected]

PR openhab#7460 broke the freebox binding

Signed-off-by: Laurent Garnier <[email protected]>
@cpmeister
Copy link
Contributor

Could you add a unit test to this as well? I'd like to prevent any future mishaps.

@cpmeister cpmeister added the bug An unexpected problem or unintended behavior of an add-on label May 19, 2020
@lolodomo
Copy link
Contributor Author

lolodomo commented May 19, 2020

I don't know where @cweitkamp put his unit test.
We cannot wait too much, the binding is just unusable until this patch is applied for any user that has migrated to OH 2.5.5 !

@TravisBuddy
Copy link

Travis tests were successful

Hey @lolodomo,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@cweitkamp
Copy link
Contributor

See #7460 (comment).

@lolodomo
Copy link
Contributor Author

I will not take a long time to introduce all the testing stuff to the binding (I am not enough familiar with that) even more when the bug was not introduced by me,
The priority is to provide a fix to end users as fast as possible.

@cpmeister
Copy link
Contributor

Just add this file and fill in the blanks:
src/test/java/org/openhab/binding/freebox/internal/api/FreeboxApiManagerTest

package org.openhab.binding.freebox.internal.api;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.junit.Assert;
import org.junit.Test;

@NonNullByDefault
public class FreeboxApiManagerTest{

    @Test
    public void hmacSha1Test() throws Exception {
        String expected = "_______";
        String actual = FreeboxApiManager.hmacSha1("_______", "_______");
        Assert.assertEquals(expected, actual);
    }

}

You will need to make FreeboxApiManager.hmacSha1 public to make this work.
Any of the classes you need to import should be

@lolodomo
Copy link
Contributor Author

Thank you for the help, I did not imagine it was just one class to add.

@TravisBuddy
Copy link

Travis tests were successful

Hey @lolodomo,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Assert.assertEquals(expected, actual);
}

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of our build tools don't like EOF without a newline. So add a newline here.

@cpmeister
Copy link
Contributor

Thank you for the help, I did not imagine it was just one class to add.

Unit testing with JUnit is made to be as simple as possible with the idea that the easier it is the more likely unit tests would be written. More tests means more stable code, so it is a win-win for developers.

Signed-off-by: Laurent Garnier <[email protected]>
@TravisBuddy
Copy link

Travis tests were successful

Hey @lolodomo,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@cpmeister cpmeister added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels May 19, 2020
@cpmeister cpmeister merged commit ac9c649 into openhab:2.5.x May 20, 2020
@cpmeister cpmeister added this to the 2.5.6 milestone May 20, 2020
@lolodomo lolodomo deleted the freebox_login branch May 20, 2020 06:43
LoungeFlyZ pushed a commit to LoungeFlyZ/openhab2-addons that referenced this pull request Jun 8, 2020
* [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]>
J-N-K pushed a commit to J-N-K/openhab-addons that referenced this pull request Jul 14, 2020
* [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]>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
* [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]>
Signed-off-by: CSchlipp <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [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]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [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]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [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]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [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]>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
* [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]>
Signed-off-by: Daan Meijer <[email protected]>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
* [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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants