11package org .schabi .newpipe .extractor ;
22
3- import org .junit .jupiter .api .Test ;
4-
5- import java .util .HashSet ;
6-
7- import static org .junit .jupiter .api .Assertions .*;
3+ import static org .junit .jupiter .api .Assertions .assertEquals ;
4+ import static org .junit .jupiter .api .Assertions .assertTrue ;
85import static org .schabi .newpipe .extractor .NewPipe .getServiceByUrl ;
96import static org .schabi .newpipe .extractor .ServiceList .SoundCloud ;
107import static org .schabi .newpipe .extractor .ServiceList .YouTube ;
118
9+ import org .junit .jupiter .api .Test ;
10+
11+ import java .util .HashSet ;
12+
1213public class NewPipeTest {
1314 @ Test
1415 public void getAllServicesTest () throws Exception {
@@ -17,8 +18,8 @@ public void getAllServicesTest() throws Exception {
1718
1819 @ Test
1920 public void testAllServicesHaveDifferentId () throws Exception {
20- HashSet <Integer > servicesId = new HashSet <>();
21- for (StreamingService streamingService : NewPipe .getServices ()) {
21+ final HashSet <Integer > servicesId = new HashSet <>();
22+ for (final StreamingService streamingService : NewPipe .getServices ()) {
2223 final String errorMsg =
2324 "There are services with the same id = " + streamingService .getServiceId ()
2425 + " (current service > " + streamingService .getServiceInfo ().getName () + ")" ;
@@ -32,11 +33,6 @@ public void getServiceWithId() throws Exception {
3233 assertEquals (NewPipe .getService (YouTube .getServiceId ()), YouTube );
3334 }
3435
35- @ Test
36- public void getServiceWithName () throws Exception {
37- assertEquals (NewPipe .getService (YouTube .getServiceInfo ().getName ()), YouTube );
38- }
39-
4036 @ Test
4137 public void getServiceWithUrl () throws Exception {
4238 assertEquals (getServiceByUrl ("https://www.youtube.com/watch?v=_r6CgaFNAGg" ), YouTube );
@@ -47,14 +43,4 @@ public void getServiceWithUrl() throws Exception {
4743 assertEquals (getServiceByUrl ("https://soundcloud.com/pegboardnerds" ), SoundCloud );
4844 assertEquals (getServiceByUrl ("https://www.google.com/url?sa=t&url=https%3A%2F%2Fsoundcloud.com%2Fciaoproduction&rct=j&q=&esrc=s&source=web&cd=" ), SoundCloud );
4945 }
50-
51- @ Test
52- public void getIdWithServiceName () throws Exception {
53- assertEquals (NewPipe .getIdOfService (YouTube .getServiceInfo ().getName ()), YouTube .getServiceId ());
54- }
55-
56- @ Test
57- public void getServiceNameWithId () throws Exception {
58- assertEquals (NewPipe .getNameOfService (YouTube .getServiceId ()), YouTube .getServiceInfo ().getName ());
59- }
6046}
0 commit comments