1 /*
2  * Copyright (C) 2015 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.volley.toolbox;
18 
19 import static org.junit.Assert.assertNotNull;
20 
21 import com.android.volley.Response;
22 import org.json.JSONArray;
23 import org.json.JSONObject;
24 import org.junit.Test;
25 import org.junit.runner.RunWith;
26 import org.robolectric.RobolectricTestRunner;
27 
28 @RunWith(RobolectricTestRunner.class)
29 public class JsonRequestTest {
30 
31     @Test
publicMethods()32     public void publicMethods() throws Exception {
33         // Catch-all test to find API-breaking changes.
34         assertNotNull(
35                 JsonRequest.class.getConstructor(
36                         String.class,
37                         String.class,
38                         Response.Listener.class,
39                         Response.ErrorListener.class));
40         assertNotNull(
41                 JsonRequest.class.getConstructor(
42                         int.class,
43                         String.class,
44                         String.class,
45                         Response.Listener.class,
46                         Response.ErrorListener.class));
47 
48         assertNotNull(
49                 JsonArrayRequest.class.getConstructor(
50                         String.class, Response.Listener.class, Response.ErrorListener.class));
51         assertNotNull(
52                 JsonArrayRequest.class.getConstructor(
53                         int.class,
54                         String.class,
55                         JSONArray.class,
56                         Response.Listener.class,
57                         Response.ErrorListener.class));
58 
59         assertNotNull(
60                 JsonObjectRequest.class.getConstructor(
61                         String.class,
62                         JSONObject.class,
63                         Response.Listener.class,
64                         Response.ErrorListener.class));
65         assertNotNull(
66                 JsonObjectRequest.class.getConstructor(
67                         int.class,
68                         String.class,
69                         JSONObject.class,
70                         Response.Listener.class,
71                         Response.ErrorListener.class));
72     }
73 }
74