MCPcopy Create free account
hub / github.com/Asana/java-asana / testAsanaChangeLogging

Method testAsanaChangeLogging

src/test/java/com/asana/ClientTest.java:157–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 8

checkLevelMethod · 0.95
contentMethod · 0.80
codeMethod · 0.80
registerResponseMethod · 0.80
headerMethod · 0.45
executeRawMethod · 0.45
optionMethod · 0.45
findByProjectMethod · 0.45

Tested by

no test coverage detected