mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-10 12:37:45 +00:00
SDK update generated by liblab
This commit is contained in:
14
src/test/java/com/plexsdk/TestTest.java
Normal file
14
src/test/java/com/plexsdk/TestTest.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.plexsdk;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
public class TestTest {
|
||||
|
||||
@Test
|
||||
@DisplayName("Tests that JUnit is working")
|
||||
public void test() {
|
||||
assertTrue(true);
|
||||
}
|
||||
}
|
||||
21
src/test/java/com/plexsdk/helpers/TestModel.java
Normal file
21
src/test/java/com/plexsdk/helpers/TestModel.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.plexsdk.helpers;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.plexsdk.models.BaseModel;
|
||||
|
||||
public class TestModel extends BaseModel {
|
||||
|
||||
public String testString;
|
||||
public int testInt;
|
||||
public boolean testBoolean;
|
||||
|
||||
public TestModel(
|
||||
@JsonProperty("testString") String testString,
|
||||
@JsonProperty("testInt") int testInt,
|
||||
@JsonProperty("testBoolean") boolean testBoolean
|
||||
) {
|
||||
this.testString = testString;
|
||||
this.testInt = testInt;
|
||||
this.testBoolean = testBoolean;
|
||||
}
|
||||
}
|
||||
39
src/test/java/com/plexsdk/http/ModelConverterTest.java
Normal file
39
src/test/java/com/plexsdk/http/ModelConverterTest.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package com.plexsdk.http;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.helpers.TestModel;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
public class ModelConverterTest {
|
||||
|
||||
@Test
|
||||
@DisplayName("Testing ModelConverter.modelToJson()")
|
||||
public void testModelToJson() {
|
||||
TestModel testModel = new TestModel("testString", 1, true);
|
||||
String json = ModelConverter.modelToJson(testModel);
|
||||
assertEquals(json, "{\"testString\":\"testString\",\"testInt\":1,\"testBoolean\":true}");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Testing ModelConverter.jsonToModel()")
|
||||
public void testJsonToModel() {
|
||||
String json = "{\"testString\":\"testString\",\"testInt\":1,\"testBoolean\":true}";
|
||||
TestModel testModel = ModelConverter.convert(json, TestModel.class);
|
||||
assertEquals(testModel.testString, "testString");
|
||||
assertEquals(testModel.testInt, 1);
|
||||
assertTrue(testModel.testBoolean);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Testing ModelConverter.convert() and ModelConverter.modelToJson() are congruent")
|
||||
public void congruency() {
|
||||
TestModel testModel = new TestModel("testString", 1, true);
|
||||
String json = ModelConverter.modelToJson(testModel);
|
||||
TestModel testModel2 = ModelConverter.convert(json, TestModel.class);
|
||||
assertEquals(testModel.testString, testModel2.testString);
|
||||
assertEquals(testModel.testInt, testModel2.testInt);
|
||||
assertTrue(testModel.testBoolean == testModel2.testBoolean);
|
||||
}
|
||||
}
|
||||
131
src/test/java/com/plexsdk/models/ModelOneOfTests.java
Normal file
131
src/test/java/com/plexsdk/models/ModelOneOfTests.java
Normal file
@@ -0,0 +1,131 @@
|
||||
package com.plexsdk.models;
|
||||
|
||||
import java.util.Set;
|
||||
import org.junit.Assert;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import utils.ArrayUtils;
|
||||
|
||||
public class ModelOneOfTests {
|
||||
|
||||
@Test
|
||||
void testWithEmptyObject() {
|
||||
BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) {
|
||||
@Override
|
||||
protected Set<String> getNonNullInstanceFieldNames() {
|
||||
return ArrayUtils.arrayToSet(new java.lang.String[] {});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Set<Set<String>> getRequiredFieldsGroups() {
|
||||
return ArrayUtils.arraysToSets(
|
||||
new java.lang.String[][] { new java.lang.String[] { "foo", "bar", "baz" } }
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Assert.assertEquals("Object fails OneOf validation.", builder.validate());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testWithEmptyObjectWithNoRequiredFields() {
|
||||
BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) {
|
||||
@Override
|
||||
protected Set<String> getNonNullInstanceFieldNames() {
|
||||
return ArrayUtils.arrayToSet(new java.lang.String[] {});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Set<Set<String>> getRequiredFieldsGroups() {
|
||||
return ArrayUtils.arraysToSets(new java.lang.String[][] { new java.lang.String[] {} });
|
||||
}
|
||||
};
|
||||
|
||||
Assert.assertNull(builder.validate());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testWithNoRequiredFields() {
|
||||
BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) {
|
||||
@Override
|
||||
protected Set<String> getNonNullInstanceFieldNames() {
|
||||
return ArrayUtils.arrayToSet(new java.lang.String[] { "foo", "bar", "baz" });
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Set<Set<String>> getRequiredFieldsGroups() {
|
||||
return ArrayUtils.arraysToSets(new java.lang.String[][] {});
|
||||
}
|
||||
};
|
||||
|
||||
Assert.assertNull(builder.validate());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testWithRequiredFieldsMatching() {
|
||||
BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) {
|
||||
@Override
|
||||
protected Set<String> getNonNullInstanceFieldNames() {
|
||||
return ArrayUtils.arrayToSet(new java.lang.String[] { "foo", "bar", "baz" });
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Set<Set<String>> getRequiredFieldsGroups() {
|
||||
return ArrayUtils.arraysToSets(
|
||||
new java.lang.String[][] {
|
||||
new String[] { "fizz", "buzz" },
|
||||
new String[] { "foo", "bar", "baz" },
|
||||
new String[] { "fish" },
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Assert.assertNull(builder.validate());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testWithRequiredFieldsNotMatching() {
|
||||
BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) {
|
||||
@Override
|
||||
protected Set<String> getNonNullInstanceFieldNames() {
|
||||
return ArrayUtils.arrayToSet(new java.lang.String[] { "alpha", "bravo", "charlie" });
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Set<Set<String>> getRequiredFieldsGroups() {
|
||||
return ArrayUtils.arraysToSets(
|
||||
new java.lang.String[][] {
|
||||
new String[] { "fizz", "buzz" },
|
||||
new String[] { "foo", "bar", "baz" },
|
||||
new String[] { "fish" },
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Assert.assertEquals("Object fails OneOf validation.", builder.validate());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testWithRequiredFieldsPartiallyMatching() {
|
||||
BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) {
|
||||
@Override
|
||||
protected Set<String> getNonNullInstanceFieldNames() {
|
||||
return ArrayUtils.arrayToSet(new java.lang.String[] { "foo", "bar", "charlie" });
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Set<Set<String>> getRequiredFieldsGroups() {
|
||||
return ArrayUtils.arraysToSets(
|
||||
new java.lang.String[][] {
|
||||
new String[] { "fizz", "buzz" },
|
||||
new String[] { "foo", "bar", "baz" },
|
||||
new String[] { "fish" },
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Assert.assertEquals("Object fails OneOf validation.", builder.validate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class ActivitiesServiceTest {
|
||||
// @ActivitiesServiceTest
|
||||
|
||||
// @DisplayName("Test that Activities is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for getServerActivities
|
||||
|
||||
// TODO: Write tests for cancelServerActivities
|
||||
|
||||
}
|
||||
12
src/test/java/com/plexsdk/services/BaseServiceTest.java
Normal file
12
src/test/java/com/plexsdk/services/BaseServiceTest.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
public class BaseServiceTest {
|
||||
//@BaseServiceTest
|
||||
//@DisplayName("BaseServiceTest that base service is working")
|
||||
//public void test() {}
|
||||
// TODO: Add base service test code here
|
||||
}
|
||||
25
src/test/java/com/plexsdk/services/ButlerServiceTest.java
Normal file
25
src/test/java/com/plexsdk/services/ButlerServiceTest.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class ButlerServiceTest {
|
||||
// @ButlerServiceTest
|
||||
|
||||
// @DisplayName("Test that Butler is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for getButlerTasks
|
||||
|
||||
// TODO: Write tests for startAllTasks
|
||||
|
||||
// TODO: Write tests for stopAllTasks
|
||||
|
||||
// TODO: Write tests for startTask
|
||||
|
||||
// TODO: Write tests for stopTask
|
||||
|
||||
}
|
||||
19
src/test/java/com/plexsdk/services/HubsServiceTest.java
Normal file
19
src/test/java/com/plexsdk/services/HubsServiceTest.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class HubsServiceTest {
|
||||
// @HubsServiceTest
|
||||
|
||||
// @DisplayName("Test that Hubs is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for getGlobalHubs
|
||||
|
||||
// TODO: Write tests for getLibraryHubs
|
||||
|
||||
}
|
||||
39
src/test/java/com/plexsdk/services/LibraryServiceTest.java
Normal file
39
src/test/java/com/plexsdk/services/LibraryServiceTest.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class LibraryServiceTest {
|
||||
// @LibraryServiceTest
|
||||
|
||||
// @DisplayName("Test that Library is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for getFileHash
|
||||
|
||||
// TODO: Write tests for getRecentlyAdded
|
||||
|
||||
// TODO: Write tests for getLibraries
|
||||
|
||||
// TODO: Write tests for getLibrary
|
||||
|
||||
// TODO: Write tests for deleteLibrary
|
||||
|
||||
// TODO: Write tests for getLibraryItems
|
||||
|
||||
// TODO: Write tests for refreshLibrary
|
||||
|
||||
// TODO: Write tests for getLatestLibraryItems
|
||||
|
||||
// TODO: Write tests for getCommonLibraryItems
|
||||
|
||||
// TODO: Write tests for getMetadata
|
||||
|
||||
// TODO: Write tests for getMetadataChildren
|
||||
|
||||
// TODO: Write tests for getOnDeck
|
||||
|
||||
}
|
||||
21
src/test/java/com/plexsdk/services/LogServiceTest.java
Normal file
21
src/test/java/com/plexsdk/services/LogServiceTest.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class LogServiceTest {
|
||||
// @LogServiceTest
|
||||
|
||||
// @DisplayName("Test that Log is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for logLine
|
||||
|
||||
// TODO: Write tests for logMultiLine
|
||||
|
||||
// TODO: Write tests for enablePaperTrail
|
||||
|
||||
}
|
||||
21
src/test/java/com/plexsdk/services/MediaServiceTest.java
Normal file
21
src/test/java/com/plexsdk/services/MediaServiceTest.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class MediaServiceTest {
|
||||
// @MediaServiceTest
|
||||
|
||||
// @DisplayName("Test that Media is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for markPlayed
|
||||
|
||||
// TODO: Write tests for markUnplayed
|
||||
|
||||
// TODO: Write tests for updatePlayProgress
|
||||
|
||||
}
|
||||
33
src/test/java/com/plexsdk/services/PlaylistsServiceTest.java
Normal file
33
src/test/java/com/plexsdk/services/PlaylistsServiceTest.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class PlaylistsServiceTest {
|
||||
// @PlaylistsServiceTest
|
||||
|
||||
// @DisplayName("Test that Playlists is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for createPlaylist
|
||||
|
||||
// TODO: Write tests for getPlaylists
|
||||
|
||||
// TODO: Write tests for getPlaylist
|
||||
|
||||
// TODO: Write tests for updatePlaylist
|
||||
|
||||
// TODO: Write tests for deletePlaylist
|
||||
|
||||
// TODO: Write tests for getPlaylistContents
|
||||
|
||||
// TODO: Write tests for addPlaylistContents
|
||||
|
||||
// TODO: Write tests for clearPlaylistContents
|
||||
|
||||
// TODO: Write tests for uploadPlaylist
|
||||
|
||||
}
|
||||
21
src/test/java/com/plexsdk/services/SearchServiceTest.java
Normal file
21
src/test/java/com/plexsdk/services/SearchServiceTest.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class SearchServiceTest {
|
||||
// @SearchServiceTest
|
||||
|
||||
// @DisplayName("Test that Search is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for performSearch
|
||||
|
||||
// TODO: Write tests for performVoiceSearch
|
||||
|
||||
// TODO: Write tests for getSearchResults
|
||||
|
||||
}
|
||||
19
src/test/java/com/plexsdk/services/SecurityServiceTest.java
Normal file
19
src/test/java/com/plexsdk/services/SecurityServiceTest.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class SecurityServiceTest {
|
||||
// @SecurityServiceTest
|
||||
|
||||
// @DisplayName("Test that Security is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for getTransientToken
|
||||
|
||||
// TODO: Write tests for getSourceConnectionInformation
|
||||
|
||||
}
|
||||
31
src/test/java/com/plexsdk/services/ServerServiceTest.java
Normal file
31
src/test/java/com/plexsdk/services/ServerServiceTest.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class ServerServiceTest {
|
||||
// @ServerServiceTest
|
||||
|
||||
// @DisplayName("Test that Server is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for getServerCapabilities
|
||||
|
||||
// TODO: Write tests for getServerPreferences
|
||||
|
||||
// TODO: Write tests for getAvailableClients
|
||||
|
||||
// TODO: Write tests for getDevices
|
||||
|
||||
// TODO: Write tests for getServerIdentity
|
||||
|
||||
// TODO: Write tests for getMyPlexAccount
|
||||
|
||||
// TODO: Write tests for getResizedPhoto
|
||||
|
||||
// TODO: Write tests for getServerList
|
||||
|
||||
}
|
||||
23
src/test/java/com/plexsdk/services/SessionsServiceTest.java
Normal file
23
src/test/java/com/plexsdk/services/SessionsServiceTest.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class SessionsServiceTest {
|
||||
// @SessionsServiceTest
|
||||
|
||||
// @DisplayName("Test that Sessions is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for getSessions
|
||||
|
||||
// TODO: Write tests for getSessionHistory
|
||||
|
||||
// TODO: Write tests for getTranscodeSessions
|
||||
|
||||
// TODO: Write tests for stopTranscodeSession
|
||||
|
||||
}
|
||||
21
src/test/java/com/plexsdk/services/UpdaterServiceTest.java
Normal file
21
src/test/java/com/plexsdk/services/UpdaterServiceTest.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class UpdaterServiceTest {
|
||||
// @UpdaterServiceTest
|
||||
|
||||
// @DisplayName("Test that Updater is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for getUpdateStatus
|
||||
|
||||
// TODO: Write tests for checkForUpdates
|
||||
|
||||
// TODO: Write tests for applyUpdates
|
||||
|
||||
}
|
||||
19
src/test/java/com/plexsdk/services/VideoServiceTest.java
Normal file
19
src/test/java/com/plexsdk/services/VideoServiceTest.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.plexsdk.services;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.plexsdk.models.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
class VideoServiceTest {
|
||||
// @VideoServiceTest
|
||||
|
||||
// @DisplayName("Test that Video is working")
|
||||
|
||||
// public void test() {}
|
||||
|
||||
// TODO: Write tests for startUniversalTranscode
|
||||
|
||||
// TODO: Write tests for getTimeline
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user