Package se.despotify

Source Code of se.despotify.DespotifyClientTest

package se.despotify;

import junit.framework.TestCase;
import org.junit.After;
import org.junit.Before;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import se.despotify.domain.MemoryStore;
import se.despotify.domain.Store;
import se.despotify.domain.User;
import se.despotify.domain.media.Album;
import se.despotify.domain.media.Artist;
import se.despotify.domain.media.Playlist;
import se.despotify.domain.media.Track;
import se.despotify.util.Hex;
import se.despotify.util.SpotifyURI;

import java.util.Random;

/**
* @since 2009-apr-20 20:41:13
*/
public abstract class DespotifyClientTest extends TestCase {

  public final String hex40 = "^[a-f0-9]{40}$";
  public final String hex32 = "^[a-f0-9]{32}$";

  protected final Logger log = LoggerFactory.getLogger(getClass());

  protected ConnectionManager manager;

  protected Store store;
  protected User user;

  protected final String[] twoHundredGoodTrackIds = {"000002f8d50f44b5b7289994bddf89cc", "00004092a2ce4cb8aa9133ba7783089e", "0000414f2c3b4f69b730a4f6db03f031", "000046f0e2ed492fab0e2044fe06b4d6", "000062586e08469caff03227db81f3da", "000084e7f99f4003bde2844f55e2581f", "0000a48e851248c6a28a40f84974b033", "0000b73f56904f559aa3b08e9de7a971", "0000ccc56ce94e44a46ab2ae121c3582", "0000d7adc4ce4f5a81324c017f32d8c4", "0000f66973134fa09e16208640c2ce1b", "0000fbe413af47c8b6a1d4712a52c97f", "00011fc4753c4c609fbd42c0b56cde81", "00012f0d21ee4437b7ee434272dd272c", "000131ed36804224b81ce9578d7a1f27", "000141f9236646279fd46c0b7b0da813", "000155444e9448328e7df477d7d0ebdd", "00015a689195423c9fd6977b927d744b", "00015ce3ee8d421abd007fb401a33c6b", "0001661b7b704768b886e367bf070ffb", "000174cfc8464a06a85c00fd7243473d", "000181958b0148b69219cadaec61aaab", "00018277f59f4bc28f7bc1c9f027e4ba", "00018e086bca4f569ad8ab4bcdd2388a", "00019eefcf3745a387a4ce3cacb2a380", "0001b30f9eb9465c972aafe3e6c9500d", "0001ba4783aa4a4e82d2ab97f8bdd4e3", "0001ffb76b7f44569fcbc123d1b9783d", "00021206a6c1432fb4287ee3fab123f4", "000223d5fc0b45c0a04c9bd24b12668a", "00025cbe73fa4842b684ce360fd369d8", "00026490b8bb4efca0dfe5f19e9639b8", "00027db18dbc49ffb273b9313f208503", "0002a432c59d48d38abdaca66b9da46b", "0002ac2fc8b54dfaa2fdfa820566a8a8", "0002bb904e2447f394222a8c282eed60", "0002ca1b950b494d9db6ae13bca64a89", "0002e08220dc48f69f1cee56307991cb", "0002e90a8cfe4010b30834fe270361d4", "0002ee48081540cd89dce56438926bcb", "0003290e71a54924bc102e9e30b23cf9", "0003311f7f6c41379f0f3e33137184f7", "000335f5d38242e186abe32736751d3c", "0003493342b74cf795b4d70cff3d1a76", "0003726994a048f888a7c81016a1b7b1", "0003906d309541de9d8e3ce09778232d", "0003c564d3d744eea6235818153aec0e", "0003cb6399eb4a10983ee5365d974a12", "0003cefb942947599e745792029898b4", "0003cf011c674c25aa72cfad0d3d58e4", "0003d44745d9464c98e3a75ec2f30541", "0003e0d7a7c543bb9a1f4044a1de98a4", "0003e6eebc844a47bad238b9e078ad4a", "000403a9494d4e25a942a75b17ebd3ff", "000409d46d0540a0a81660c39a5f09cc", "00040dc925b3489491b5076c5a290093", "00040faeca5243ca99415cf511593b0d", "00042022d182478087c31980ea766e29", "00042f16571b478bbff24e282528e5e2", "0004ac8d197c42b88a50eb6652e69858", "0004bd8f89db478dbe4e99fce74a7bef", "0004eb4a2a21439b9aba895847533c54", "0005028da38a4eafa96ff935bd7df89d", "00053c690f4a4dc584d8665698164e60", "00055692f95942de97e5a993f2f4297f", "000557e1f7994450b1872609c233bb12", "0005c3a25b014e7c8a28bc69ae04afc9", "0005c3a8a79b408da780af9433b96c38", "0005c6fd68584254b3945c9e6c3dd7a6", "0005e05ad87c4942b167fb6ebf04c757", "0006108bd8604216815429e80fc227d9", "0006117a0dbd471baa8282f43be05a27", "0006179047164949b18ec016072f2a86", "0006223a9ba340609e362bac727abd67", "000627098bc642aa8321412a292330f9", "0006371671f04e068f109e65a9ba20fe", "000639857a6648b7a1f101fd65cb1e58", "00064a2ce0f74fc9aa2b06874524294f", "0006652f1b36472ebbaea358f7f9fb4d", "00066ce1ae9f4bbb9e26fe51e24f4f86", "000673a2d1e9426d99cfdce3c1b4f32b", "00069ddd82974a7b9440c3f86b613ec1", "0006cdd263be4cdf9a32bcd46ef63aca", "0006dc18567f441396bdf3317469dae8", "0006f5895e5c440cbe37803452446d54", "0007021ca98444468d3348703ddb9841", "00070e64681f4e06810c439051366c7f", "00070f0a28bb4c45bb59910824341b84", "00071bdd1418419da6a421a0fbc58d07", "00071d377caa49f1b0c00444b5345f23", "00075150d2884b4a995900a33f94a658", "0007595961d94e75b151a81865861ccd", "000767bd89f54fa48e691baee05d4376", "000773536dce4d28b558eca483c4cab5", "00078aaef68140f1af5d6ec1f60d6eb8", "0007b8d5e9004f019c178a20d1052a9c", "0007e43e1e3742e4826270da283ac0c0", "0008104cb48147e099b99f49993e4974", "0008200c90cd4c1fadcf093748749118", "000835e6b97c488595907bfb813c8ebd", "00083c2301de4682af6c57b6af1be9af", "00086216e2f743689713603573612bb7", "00088b8f6fa64c7d8097b1bbb0058498", "000891c9f68d461f9e13c6cd3f0b81fd", "000899e9723d457ba35d21360c4d2428", "00089ac9500c4a8e835cef9b7eb6e977", "0008b1dcef254feeb87ed55ff36fa557", "0008bf82230c45daac8e0651067450d6", "00091cd20d49409a9023b8a3b4f5eac7", "00093c468a4249f985ec2fbf9b3376b6", "000940fd0b014e759e2bf33bea8c5454", "00094a75501d454599d3a058b2c10e8f", "00094b26796c4b67adee5f39e4d805bc", "00095b505ce24dfab6557aff615dc14b", "000971c1c3a647be860264cb05dd20b3", "00099f337db84f2aafda4e7bbb7ef42b", "0009b92790bd422db674babb0c90ea89", "0009cf9f897c45559bf5928535a91b67", "0009f9eec7eb4815a3ad8210541dcaa8", "0009fdfe9c3042dc9ae16bb445dc57ad", "000a0176bb714a8e995b3fcf0c800d25", "000a13fb4c3c46e69c6a99e50a600846", "000a19f95fdc47fc9f6c500883c2bce0", "000a394673be4477b5f219e95ced291b", "000a41430ff94106b5f5c8a7be6f4a2e", "000a44e09aa448a1b1ef55d032def731", "000a5789c3074b9ca17e1ec8125db362", "000a5cf339d24df985a238e4576e9463", "000a7f689f1740cf8d8948cecebd00ca", "000a818a73384d3e8909f1866fb7d245", "000ac510c631492e84cba1dad40fa517", "000ad8c1e44c4c1b9ea3034fc58a70f6", "000aee1f1a2d4ba2a43e41d16e896fe6", "000af1cbd5b34eb2aae938a004508b43", "000afd5c35c04575a741e13af6bff891", "000b2de05c4d45aeb9531f3a604bedf9", "000b42889c1d4ad5b31c04b72ad5d4cc", "000b531ae0c9425183c1e5c4144495dc", "000b5e3c58154f1884f1bd73b2cc55b2", "000b8d1ae0fd4fd6bdc5ac1dd33edaf8", "000bbc2df86544308e9850c478a70f12", "000bc499d02f490ca45745ed27bb8c44", "000be1d92da74f468c1d575f7ff60572", "000bf287f60b4a34b2599ca833c065d4", "000bf6247ce64c3b814f4cdef42fc1ab", "000c254852864a92a1ddbe475baada6d", "000c2c1c1a4745bcb4ea4ea797c89e48", "000c5a4290ed45709b1778aa98b5d4cb", "000c68cf9bee4b3b98f0fb1284f522fd", "000c6f05e4ea43d4803fabd7ba5fb944", "000c891320654573aaff20ebb776ef92", "000c951f6a8047acbe830c3e2e148de2", "000ca3784e9a465c9d57989462fad29e", "000cba7b60144c9c8d9e62ca24565fc0", "000ccdec7d10486c8e942756e0a0590e", "000cdf449cf94cd78dfe6047db0a7721", "000d385a97844f34903bea1cb88508af", "000d49d59e9b4cc2b6ee95419503475f", "000d4a29e11046fbbc7d7ac741dc04f4", "000d6d2164b84dbca1142d597f1f7331", "000da1b452f6457ab8ad9c46f6fe4fa6", "000dcc268476435ab22da850dffddfe4", "000dd5c8fcc74f3b88703ab1c4329635", "000dde57e82041c981c4dad27e706adc", "000de57fb2324d7eacb4f6db1c58ebec", "000deaf349bb49c7bb6dce98c3f4f260", "000dee6b92f64331b768c2e6d5028632", "000df7eff6264d87a2a413aeb6252754", "000dff5e90714d35a787cb86cfe152c6", "000e04a9d84c443ebe4f8c934bc1681b", "000e1e6caabc43ac917effadcc45cc9b", "000e2f1067754b1f84e1091ee535087d", "000e3521678940f493fc82a98e457625", "000e42bd5916455f92be1c7a300162f8", "000e723e880247cb85df347b33d61298", "000e74d9ef3c401eb2640d820d8affd4", "000eab1c99af41c4b1c5de9834f3b11a", "000ed6dc71694853929adfd493cd603d", "000f0465416f4cc79aca1d8c356cd94b", "000f2c2d2544430fb692a24e70446973", "000f31fb62a440c4a2aa617fb225952f", "000f5d8155574d628db4cb8efa59d97c", "000f681b8eb44530a92196a63d60bf94", "000f8adc6ae34f5bbc82a483e702195b", "000fb17f83c14528a2eee932e82ee7ef", "000fba6f68bc463088ced2694a4d5cbe", "000fe8d54df94226b8407597c46fb83c", "000fed82993842778b7d25074bff0c89", "00100c81080f4b7a8d1b661fe61480d7", "00101199e44445c7b5ca08eb9f19127f", "0010242cf1ab4cdd9b7294bce7639da4", "0010267f99444a0593fe16d12908556d", "001038de53634ee686801a50a3e3e892", "00106a4aae6148b88faf4c3b450c8205", "00107d400eca4df78902b56e3b0d3942", "00108667758641efba4d0ef0c26908cf", "0010c9c70c9a46c4b55c463434255f91", "0010e7da901049cb91f3d5c375294f96", "00110be9c534416bb718be72c88f5b77", "00113dd7c77a4efb8b0d0d3285ceb306"};
  protected final String[] twoHundredGoodArtistIds = {"00003a64c6a241a59d814b12a0b217b5", "0001212968174e15ba131bcf7e390ac6", "00014ff36d564bc6aa9d15581c01efd4", "0001fef4775f406d94441bfcc9ed8740", "0002913321d6492e9b20221b3d358c90", "00048da1a7c145f0be665fff325e0725", "0004950ac24845ad93c7974a908f8dee", "0004a45be98a4895ba91186297540469", "00050d150ca44327af98e27ba9383186", "0006032e99d24b9b8217313f436a6a7b", "000718a7e4964a75b9a9f65dd049a6e5", "0007402105d5434eb13c43857754cb4d", "000749b05842454a92b0c946f0038f0e", "00074e33885f42d889d7541de00375d4", "0009be404f1341a9b4e48d6aff55645e", "000a067a9c414d739c4f313374f27edc", "000a70d4050a4b52b278c38c99d26344", "000c5e612b864bb88f017c509eb09ef5", "000c9358f92742a5a5fccb9c583a0e80", "000cfea7ff044e73b55cba4607a3d9d9", "001090bc151e48d48203b6c990cd7c69", "0012230dd8884bb0a2fbba6063d311c4", "0012ce2a5d874b759366c082bd0d67e0", "0012d3e3109c453ca5608c037ffb6b49", "0012efeee0824470aee8b844e83b47ab", "001436bba48e44f5b18bf0b014656c32", "001545e094244811ae5b8e037ce03229", "001584b607f042ee87c1dae1e38e344e", "0015ca2efc6643f0b84a707489264320", "0015d78be3d94b9fa0526b8d06b1036f", "0016b4fcde3b437f9a53210067f1ef30", "0016d2c445dd4c8aa8aa92631791e190", "00174faeb8bc492eba4821fd7d8a4ace", "0018413c268f469d8c891f1e9885271e", "001871d1b312462292bfa92400c2df04", "0018af8c0d834e438fe79d989aca0441", "0018e92c6feb43139233203527143f0a", "001af4c4671447acad662eecd9413f0d", "001b12ff28af4a458d3575a0bba12ac1", "001cb303be8e4685ab52513d669eb36c", "001d63e919ce4f3bb87b28e0b2813471", "001d783ff67a41b8ae8f0d4342df749c", "001eb9b7077941e492f1c3cde9c5dff2", "001ec77a9cc945919348d8f1adb717cd", "001eed2f811d489397aeae8237e4f1fc", "001ef0aeb30d47b0adfd48d8fe5cc711", "001f2c2a4a304385b79f1ff507d73830", "001f47ff3f3740df9b08af590b88cdb2", "001f50fff54c4c5f9f670087cf2aad5c", "001f596ff09847cf862a874c0d7983b2", "001f622cff2a4c1faf595322755dc039", "0020deb88f484f3b90ae26c1dda22ff9", "0020f74ef11f447ba945e3e733065ffa", "00210e880ae84c808be0c911e13926ad", "002195a0098d46a9a91afd1ffa6eec08", "0022d1813c6c47f6b70ea7f60c027bbc", "002354ca24b9489d90444a05468a1a9a", "00239d4b44714770aec6d50ff6a5d866", "002696c84498440088e58b0a4c8e3f2d", "0026b5709e374caf9894c8481ea026f1", "0026d7f91af643d68d7a50c4e7d1f8fd", "00282661ac314d349b856ec31ffe1847", "0028b7fd2c814893985ba466a9db8656", "0028fd1bb6554240af53b3effbf9f217", "00299da6a865454ba9e9707c7e8fd9d9", "0029b8d8d2564def8a70a3fced3585fc", "002a7a319b6f4f2588b082ac6d0f5c44", "002b7bf7d4d34be1969cf6dd79e80ddf", "002ba612433b4f7db5f9df904ca075c0", "002bb41c1f424238af5346e40dd9eb69", "002c122b21834b2093d14916b29bae1e", "002cbdfd7bb6457886a7af27206d5049", "002ebb4c088749f48a6552592aebc0f0", "00325e3237ae4610961b06bb4bc55c7f", "0032807caae549c19a7a8681b3a0129b", "0032a0af23ec44588831662c1fba45d0", "003571e02c75488e86954289f298a205", "003681247ae347528f2b99fe5e692832", "0038926f9b9e4febbbe526c9820a1e95", "0038fb2141f341989d7b886076956a14", "003905fc5cec480c81d5d7b456c5c204", "00392c41737748b78f14271cbd277da6", "00398890c2f946788802c802b6f21a59", "003ac7b5853641c792c55d9553312c48", "003b5c11481449b8893a92d626014fb7", "003beddb8af949b2a11a6f46777093b6", "003c0871d6ca4917b8507e5fce97908c", "003c08b5a3a9472e8c395fdd403a05a3", "003da4723a97462c9162fb5d5c193536", "003e761d617b4036a91ba5d7d994d7b1", "003e922614934dc78fdc4a3dc6af68c5", "003f245748b94bf389478772b33f5e75", "00408086a0ac489ebbbe43f44cb619b3", "00413e9f667945e0bc80cad4eca084e9", "004180136d5a49cbbbe85e3eb622c3f0", "00421b06804f4159b2d7590de69af7f5", "004475f398784499a4240917f13674be", "0044fe536f6747d5bb1c81d7d95e6eea", "0045b1c2a90e4d159ecfc05102d5a363", "004632b48d824a488b534765fccc4e75", "00465afaf9f44b47a08b0223ecd8f96f", "004693a940e74ee0b2f999146ecd1483", "0046da9dcc744424866fce703c1d7e62", "0047f48bffe34dafa12e72507cd1be94", "00488356d9d54c298ffa57af09345b4c", "00493b574ee84d1299ed09bcbc7fc522", "004ad3e4222d4755b77caece7d20f6f3", "004b039d90f6460195fb485f11bc1aab", "004b3dbb549346688da5d68351746762", "004b777288bd4508ad49c7d97ddae817", "004ba1bab4b74d00873863a67aa12e8a", "004c71ce15774680a34ac1718a2be44b", "004d0ee7587e4617b9045c59c106e808", "004d19ca8ede40d8af6c489eacf22d1f", "004e09e8aa9a4755ae03cc8cf9896f1f", "004e5d367d654e4f83b1a57a2d6c0e91", "004e8b92998b45dea4af8fe54dde9df2", "0050453fa57e4c4896a63083f327d5f3", "0050d8f3be534c2d8df4cbc7e9cd938b", "0050f41271124736b6c2c2d5f5653eef", "00526d74543246719dfc8be6f9a18b3e", "0052ce254f9648489af231f3a00f72c6", "0053b1d2158d4d018792ff4accd1307d", "0053de308fa047cea399481e587f5cad", "00549356ad0d4b69a5ff86b2c9b08458", "0054f9fabb9f42ec8509e99bf639cb43", "0055a6f16b554142a68f0906e2d575cd", "0055b83aa2da4ab7a307cd6a472a2f86", "00561348230b444e9fcb939d53e02c56", "005740d5107e496a98b3872d595a18d4", "0057733aab804754a8ab900d9392c39c", "005788ebc15b480da246af53fa21a91b", "00579aa1a1724a25b7939af0fa7346c8", "0057f36ea5914b5bae466f07b32f5134", "005a5028ebf34ec09074069e5f2e751f", "005a758493b94c5bafa320823a1e2566", "005ac2969dca4faf9ebfe3047bb65c1e", "005adb408ffe43c58f9f131d9c452572", "005b416e020f44b8bceda355ec2e1260", "005b416e21384cd8beb0ca04f250b478", "005bf797cd854c4dbfe9ffbfcd326b78", "005d065229cf4bcf95a6169cdf10bdd6", "005d0665327a46f9b34455516d2c49db", "005e0701412f43c5bbb4307ff91dee2c", "005eeab42541474ca8b17ff75d74718d", "0060d6b596d240c7bcb9ded297d653fe", "0062482edde341578e74a4c213443f5b", "00625928b99b4747931b623080462da8", "0062d4d3a7b34a4bb7ec423cab283981", "0063a30e53b4496b8528dd870fccbdef", "00646d7bfb9442f7801ec3de426b765e", "0067b3ef1e504e198bdf74c567d0de4d", "006806a7b58145f3a309d12ad278034b", "0068352fe48f42209afdfab402de0204", "0068cbad6a3f4244a9b9937900f5adac", "0068f79955d44f3687812a284ff6435c", "006b5593efb84d6080f0faeb0cc5e53d", "006b8c36789e4a338d59c1a29a54a90b", "006bb336a82549f493f53a9c6b846bdf", "006c241816c341d89dbcc51e290b0363", "006c57c2bd724bdca456c4ff4f69368e", "006c64e718e34c9ca6fd5b3f86382e8c", "006cbbd81aba48ae9d277876e005fb65", "006ce5afb9364295b82ab2de327dd252", "006f2a2a32564827b2a8338b57be275f", "006f7de7b89f4270a16e4df5f2e08336", "006fd271d1194bd7b9885fdc091e00ea", "006fee2ead9e4b4bb754ce84e8faa46b", "0070308a925b4d0dbe0858d202faa8cf", "0070cca293be45d18ddf3d992f9ad17c", "007159bc202843799f010a5a29784c68", "0071c2b3ed0946ef9aa2713df156ec45", "0072c1cb2bdc48cc8c7819c47969ff50", "0075078abf2049ef88de03354844c6f3", "0075c0d7d36c46c297805ef75a18b2ca", "00761bb14b6940268d9707fe72a09b4b", "0076f7d8ddc7472184429746e2a92baf", "0077bb26d327429282ea1de5dbd1261d", "0077efcec73b4418979a1a7156c7175e", "00780ea918c54758a4a7a1aa0593993f", "007b2ba0df314104a42fe17f27f8404e", "007b9ebfe00a4a1c98b436112b76b5ae", "007c82c8b4d1482c93e500e51d6a5a70", "007cbe2c923d4f749379963a4da8503f", "007d40997ca44dd68040ea496759cfba", "007e514d78d144d4a6ccf2cdfe3f88e1", "007e74a49a334ddbb4ac78467f8cf3b9", "007e9f9ef880441fafea937c9d32620b", "0080165a57ee4113a30caf697b61b9e5", "008076ce1d1740c593739ddbd4a9642b", "00811b7fd31f4b2287cb042cfc19b7df", "0082e3c054b44b6a8563e8997797ffbb", "00855f2003bd424094a283aeb77e860f", "0085b695bd874eb0b6ac29c11192d5b2", "0085bf81c6c94018a09d14699df3c8b3", "0086b3ba69894e7d8d73d38164dedc1a", "0087289c1e694514ae0330b4a188ffdb", "63e74d2a62664f358c97ce106988cba0", "1ee6fd593d354b93835c21dff2c522b8", "d00d9e7b82894fb8851a109c82568eb5"};

  protected Playlist defaultPlaylist;
  protected Artist[] defaultArtists;
  protected Album[] defaultAlbums;
  protected Track[] defaultTracks;

  protected String username;
  protected String password;

  public String randomPlaylistName() {
    long seed = System.currentTimeMillis();
    Random random = new Random(seed);

    byte[] playlistNameBytes = new byte[8];
    random.nextBytes(playlistNameBytes);
    return "despotify_" + getClass().getSimpleName() + "_" + Hex.toHex(playlistNameBytes);
  }

  /**
   * reconnected to spotify with a new empty memory store.
   *
   * @throws Exception
   */
  public void reset() throws Exception {
    if (manager != null) {
      manager.stop();
    }
    manager = new ConnectionManager(username, password);
    if (doConnect()) {
      manager.connect();
    }

    user = new User();
    user.setId(username);

    store = new MemoryStore();

    defaultPlaylist = store.getPlaylist(Hex.toBytes(SpotifyURI.toHex("6wvPFkLGKOVl1v3qRJD6HX")));

    defaultArtists = new Artist[]{
        store.getArtist(Hex.toBytes(SpotifyURI.toHex("6kACVPfCOnqzgfEF5ryl0x"))),
        store.getArtist(Hex.toBytes(SpotifyURI.toHex("2qc41rNTtdLK0tV3mJn2Pm"))),
        store.getArtist(Hex.toBytes(SpotifyURI.toHex("6FXMGgJwohJLUSr5nVlf9X"))),
        store.getArtist(Hex.toBytes(SpotifyURI.toHex("7rZR0ugcLEhNrFYOrUtZii"))),
        store.getArtist(Hex.toBytes(SpotifyURI.toHex("7ulIMfVKiXh8ecEpAVHIAY"))),
    };

    defaultAlbums = new Album[]{
        store.getAlbum(Hex.toBytes(SpotifyURI.toHex("05BIC4TZptbiQoF03QhojS"))),
        store.getAlbum(Hex.toBytes(SpotifyURI.toHex("2mLIJwfgNPGjpuKaN7njPm"))),
        store.getAlbum(Hex.toBytes(SpotifyURI.toHex("5CnZjFfPDmxOX7KnWLLqpC"))),
        store.getAlbum(Hex.toBytes(SpotifyURI.toHex("6eEhgZIrHftYRvgpAKJC2K"))),
        store.getAlbum(Hex.toBytes(SpotifyURI.toHex("3GETv5yNXeM0cnhq8XahWu"))),
    };

    defaultTracks = new Track[]{
        store.getTrack(Hex.toBytes(SpotifyURI.toHex("4vdV2Eua6RkUoUM51jdH56"))), // 93f98ea75b4748f797668485a3d01bd0
        store.getTrack(Hex.toBytes(SpotifyURI.toHex("6iVTOPCmpABvG9jDZ2JozY"))), // cf2cd530980e450d855977ba0a80ec6e
        store.getTrack(Hex.toBytes(SpotifyURI.toHex("7FKhuZtIPchBVNIhFnNL5W"))), // fc1f1b5860f04a739971fcad9c1cd634
        store.getTrack(Hex.toBytes(SpotifyURI.toHex("3qqKWUVfiLMrNPacFRzTzh"))), // 7093f50c9ecf428eb780348c076f9f7f
        store.getTrack(Hex.toBytes(SpotifyURI.toHex("2dtvgPd3vsotKXtGk4dWlg"))), // 48daf12f96f84793a526b579aa4d1f66
    };

  }

  @Before
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    try {
      System.getProperties().load(getClass().getResourceAsStream("/despotify.properties"));
    } catch (Exception e) {
      log.warn("could not load properties file", e);
    }

    username = System.getProperty("despotify.username", null);
    password = System.getProperty("despotify.password", null);

    if (username == null || password == null) {
      throw new Exception("Both -Ddespotify.username and -Ddespotify.password must be set or set in src/test/resources/despotify.properties");
    }

    reset();

  }

  protected boolean doConnect() {
    return true;
  }

  @After
  @Override
  protected void tearDown() throws Exception {
    log.info("Tearing down test..");
    super.tearDown();
    if (manager != null) {
      manager.stop();
    }
  }
}
TOP

Related Classes of se.despotify.DespotifyClientTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.