-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #214: Handle DATA commands without actual data
- Loading branch information
Showing
2 changed files
with
40 additions
and
28 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
33 changes: 33 additions & 0 deletions
33
dbus-java-tests/src/test/java/org/freedesktop/dbus/connections/SASLTest.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 @@ | ||
package org.freedesktop.dbus.connections; | ||
|
||
import org.freedesktop.dbus.connections.SASL.Command; | ||
import org.freedesktop.dbus.connections.SASL.SaslCommand; | ||
import org.freedesktop.dbus.test.AbstractBaseTest; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
|
||
public class SASLTest extends AbstractBaseTest { | ||
|
||
@Test | ||
public void testCommandNoData() throws IOException { | ||
Command cmdData = new Command("DATA "); | ||
assertEquals(SaslCommand.DATA, cmdData.getCommand()); | ||
assertNull(cmdData.getData()); | ||
} | ||
|
||
@Test | ||
public void testCommandWithData() throws IOException { | ||
Command cmdData = new Command("DATA blafasel"); | ||
assertEquals(SaslCommand.DATA, cmdData.getCommand()); | ||
assertEquals("blafasel", cmdData.getData()); | ||
} | ||
|
||
@Test | ||
public void testCommandAuth() throws IOException { | ||
Command cmdData = new Command("AUTH "); | ||
assertEquals(SaslCommand.AUTH, cmdData.getCommand()); | ||
assertNull(cmdData.getData()); | ||
} | ||
|
||
} |