assertSame("descriptor should work", expectedDesc, test.getDescriptor());
}
public void testParams() {
Map<String, Object> params = Maps.newHashMap();
ActionDef def = Mockito.mock(ActionDef.class);
Action test = new MyAction(null, def, params);
LoggingContext.KeyValueLogger logger = Mockito.mock(LoggingContext.KeyValueLogger.class);
assertSame("params should be initialized", params, test.getParams());
params.put("a", "b");
test.logParams(logger);
// logable values of null should avoid calls to the logger.
Mockito.verifyNoMoreInteractions(logger);
Mockito.when(def.getLoggableParams()).thenReturn(Lists.newArrayList("a", "b"));
test.logParams(logger);
Mockito.verify(logger, Mockito.times(1)).log("a", "b");
Mockito.verify(logger, Mockito.times(1)).log("b", "null");
Mockito.verifyNoMoreInteractions(logger);