()
| 155 | } |
| 156 | |
| 157 | @Test |
| 158 | public void testAsanaChangeLogging() throws IOException |
| 159 | { |
| 160 | Logger logger = Logger.getLogger(Request.class.getCanonicalName()); |
| 161 | LogHandler handler = new LogHandler(); |
| 162 | handler.setLevel(Level.ALL); |
| 163 | logger.setUseParentHandlers(false); |
| 164 | logger.addHandler(handler); |
| 165 | logger.setLevel(Level.ALL); |
| 166 | |
| 167 | String req = "{ \"data\": [ { \"gid\": 1 }],\"next_page\": {\"offset\": \"b\",\"path\": \"/tasks?project=1&limit=5&offset=b\",\"uri\": \"https://app.asana.com/api/1.0/tasks?project=1&limit=5&offset=b\"}}"; |
| 168 | dispatcher.registerResponse("GET", "http://app/projects/1/tasks?limit=5&offset=a").code(200).content(req) |
| 169 | .header("asana-change","name=string_ids;info=something;affected=true") |
| 170 | .header("asana-change", "name=new_sections;info=something;affected=true"); |
| 171 | |
| 172 | client.tasks.findByProject("1") |
| 173 | .option("limit", 5).option("offset", "a") |
| 174 | .executeRaw(); |
| 175 | |
| 176 | assertEquals("Log level as expected?", Level.WARNING, handler.checkLevel() ); |
| 177 | } |
| 178 | |
| 179 | @Test |
| 180 | public void testAsanaChangeLoggingIgnoreCase() throws IOException |
nothing calls this directly
no test coverage detected