+
+ @Test(expected=StreamCorruptedException.class)
+ public void musicRestResponseDataParsingTestBytes() throws Exception {
+ List<Row> rows = new ArrayList<Row>();
+ //ByteBuffer byteBuffer = ByteBuffer.allocate(6);
+ ByteBuffer buff = Charset.forName("UTF-8").encode("Hello, World!");
+ Mockito.when(rw.getBytes("attribute_bytes")).thenReturn(buff);
+ rows.add(rw);
+ Mockito.doReturn(rows.get(0)).when(result).one();
+ assertNotNull(MusicUtil.musicRestResponseDataParsing(result, "TEST"));
+ }
+
+ @Test
+ public void testMusicSerialize()throws Exception {
+ String data="TEST";
+ MusicUtil.musicSerialize(data);
+
+
+ }
+ @Test
+ public void testParseMetaData()throws Exception {
+
+ Mockito.when(rw.getString("primary_id")).thenReturn("TestSession");
+ Mockito.when(rw.getString("creation_time")).thenReturn("2018-07-03T10:15:30.00Z");
+ Mockito.when(rw.getString("last_access_time")).thenReturn("2018-07-05T10:15:30.00Z");
+ Mockito.when(rw.getString("max_inactive_interval")).thenReturn("PT20.345S");
+ MusicSession session=MusicUtil.parseMetaData(rw);
+ assertNotNull(session);
+
+ }
+
+ @Test
+ public void testMusicSerializeMusicCompress()throws Exception {
+ PowerMockito.when(MusicProperties.getProperty(MusicProperties.MUSIC_SERIALIZE_COMPRESS)).thenReturn("true");
+ String data="TEST";
+ MusicUtil.musicSerialize(data);
+
+
+ }
+