Skip to content

Commit 10543aa

Browse files
committed
Merge branch 'master' of https://github.com/Twasi/websocket-obs-java into feature/cd
2 parents 0febaba + 7a379a8 commit 10543aa

File tree

17 files changed

+294
-415
lines changed

17 files changed

+294
-415
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,20 @@ binding you want (depends on the vendor)
100100

101101
If you miss an endpoint feel free to make a pull request. Any help is appreciated.
102102

103+
### Building
104+
105+
If you've forked the repository and want to run the install goal to use your fork in your own project, please be aware
106+
the artifacts generated require being signed via GPG.
107+
108+
Once you've installed GPG and created a key-pair, you'll be prompted for your passphrase everytime you run the build.
109+
You can automate this by supplying `gpg.passphrase` property during the build, for example:
110+
111+
```
112+
mvn verify -Dgpg.passphrase=YOURPASSPHRASE
113+
```
114+
115+
In IntelliJ, you can supply the property via `File > Settings > Build, Execution, Deployment > Maven > Runner > Properties`.
116+
Once the `gpg.passphrase` property has been set there, you won't be prompted everytime you run the build.
117+
103118
---
104119
**Thanks to Palakis for the great plugin!**

pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<name>obs-websocket-java</name>
77
<groupId>net.twasi</groupId>
88
<artifactId>obs-websocket-java</artifactId>
9-
<version>1.0.7</version>
9+
<version>1.1.0</version>
1010

1111
<description>Library to connect to the OBS WebSocket interface.</description>
1212
<url>https://github.com/Twasi/obs-websocket-java</url>
@@ -88,6 +88,10 @@
8888
<version>1.5</version>
8989
<configuration>
9090
<skip>false</skip>
91+
<gpgArguments>
92+
<arg>--pinentry-mode</arg>
93+
<arg>loopback</arg>
94+
</gpgArguments>
9195
</configuration>
9296
<executions>
9397
<execution>

src/integrationTest/java/net/twasi/obsremotejava/test/OBSCommunicatorSecuredIT.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
import java.util.concurrent.TimeUnit;
1212
import java.util.concurrent.atomic.AtomicReference;
1313

14-
import static org.junit.jupiter.api.Assertions.*;
14+
import static org.junit.jupiter.api.Assertions.assertEquals;
15+
import static org.junit.jupiter.api.Assertions.fail;
1516

1617
/**
1718
* Read comment instructions before each test
@@ -33,10 +34,8 @@ class OBSCommunicatorSecuredIT {
3334
*/
3435
@Test
3536
void testConnectToSecuredServerWithoutPasswordInvokesConnectionFailedCallback() throws Exception {
36-
String websocketPassword = null;
37-
3837
WebSocketClient client = new WebSocketClient();
39-
OBSCommunicator connector = new OBSCommunicator(true, websocketPassword);
38+
OBSCommunicator connector = new OBSCommunicator(true, null);
4039

4140
AtomicReference<String> testFailedReason = new AtomicReference<>();
4241
AtomicReference<String> connectionFailedResult = new AtomicReference<>();
@@ -51,7 +50,7 @@ void testConnectToSecuredServerWithoutPasswordInvokesConnectionFailedCallback()
5150

5251
connection.get();
5352

54-
connector.registerOnDisconnect(response -> System.out.println("Disconnected"));
53+
connector.registerOnDisconnect(() -> System.out.println("Disconnected"));
5554

5655
connector.registerOnConnect(response -> {
5756
testFailedReason.set("Connected without a password to secured server");
@@ -103,7 +102,7 @@ void testConnectToSecuredServerWithInCorrectPassword() throws Exception {
103102

104103
connection.get();
105104

106-
connector.registerOnDisconnect(response -> System.out.println("Disconnected"));
105+
connector.registerOnDisconnect(() -> System.out.println("Disconnected"));
107106

108107
connector.registerOnConnect(response -> {
109108
testFailedReason.set("Connected with an incorrect password to secured server");
@@ -138,10 +137,9 @@ void testConnectToSecuredServerWithInCorrectPassword() throws Exception {
138137
*/
139138
@Test
140139
void testConnectToSecuredServerWithCorrectPassword() throws Exception {
141-
String websocketPassword = obsPassword;
142140

143141
WebSocketClient client = new WebSocketClient();
144-
OBSCommunicator connector = new OBSCommunicator(true, websocketPassword);
142+
OBSCommunicator connector = new OBSCommunicator(true, obsPassword);
145143

146144
AtomicReference<String> testFailedReason = new AtomicReference<>();
147145

@@ -155,7 +153,7 @@ void testConnectToSecuredServerWithCorrectPassword() throws Exception {
155153

156154
connection.get();
157155

158-
connector.registerOnDisconnect(response -> System.out.println("Disconnected"));
156+
connector.registerOnDisconnect(() -> System.out.println("Disconnected"));
159157

160158
connector.registerOnConnect(response -> {
161159
System.out.println("Connected successfully with password!");

src/integrationTest/java/net/twasi/obsremotejava/test/OBSCommunicatorUnsecuredIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class OBSCommunicatorUnsecuredIT {
1717
* - Make sure your OBS is running and available for connection
1818
*/
1919
private final String obsAddress = "ws://localhost:4444";
20+
private final String obsPassword = null;
2021

2122
/**
2223
* Before running this test:
@@ -39,7 +40,7 @@ void testConnectToUnsecureServerWithoutPassword() throws Exception {
3940
client.connect(connector, echoUri, request);
4041
System.out.printf("Connecting to : %s%n", echoUri);
4142

42-
connector.registerOnDisconnect(response -> System.out.println("Disconnected"));
43+
connector.registerOnDisconnect(() -> System.out.println("Disconnected"));
4344

4445
connector.registerOnConnect(response -> {
4546
System.out.println("Connected successfully without password!");

0 commit comments

Comments
 (0)