Skip to content

Commit 50f349d

Browse files
Changed event source from Object to StreamPlayer.
I felt that Object was too general, and therefore makes the intended usage less obvious. It doesn't make any difference i practice.
1 parent 634c991 commit 50f349d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/main/java/com/goxr3plus/streamplayer/stream/StreamPlayerEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class StreamPlayerEvent {
3838
private int encodedStreamPosition = -1;
3939

4040
/** The source. */
41-
private Object source = null;
41+
private StreamPlayer source = null;
4242

4343
/** The description. */
4444
private Object description = null;
@@ -55,7 +55,7 @@ public class StreamPlayerEvent {
5555
* @param description
5656
* the description
5757
*/
58-
public StreamPlayerEvent(Object source, Status status, int encodededStreamPosition, Object description) {
58+
public StreamPlayerEvent(StreamPlayer source, Status status, int encodededStreamPosition, Object description) {
5959
this.source = source;
6060
this.playerStatus = status;
6161
this.encodedStreamPosition = encodededStreamPosition;

src/main/java/com/goxr3plus/streamplayer/stream/StreamPlayerEventLauncher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class StreamPlayerEventLauncher implements Callable<String> {
5050
private List<StreamPlayerListener> listeners = null;
5151

5252
/** The source. */
53-
private Object source = null;
53+
private StreamPlayer source = null;
5454

5555
/**
5656
* Instantiates a new stream player event launcher.

src/test/java/com/goxr3plus/streamplayer/stream/StreamPlayerEventTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
import com.goxr3plus.streamplayer.enums.Status;
44
import org.junit.jupiter.api.BeforeEach;
55
import org.junit.jupiter.api.Test;
6+
import org.mockito.configuration.IMockitoConfiguration;
67

78
import static org.junit.jupiter.api.Assertions.*;
9+
import static org.mockito.Mockito.mock;
810

911
class StreamPlayerEventTest {
1012

11-
private Object source;
13+
private StreamPlayer source;
1214
private Object description;
1315
private Status status;
1416
private int encodededStreamPosition;
@@ -17,7 +19,7 @@ class StreamPlayerEventTest {
1719
@BeforeEach
1820
void setUp() {
1921
description = new Object();
20-
source = new Object();
22+
source = mock(StreamPlayer.class);
2123
status = Status.RESUMED;
2224
encodededStreamPosition = 12345;
2325
event = new StreamPlayerEvent(source, status, encodededStreamPosition, description);

0 commit comments

Comments
 (0)