use of com.megaease.easeagent.plugin.api.config.AutoRefreshPluginConfigImpl in project easeagent by megaease.
the class MongoBaseTest method before.
@Before
public void before() {
EaseAgent.initializeContextSupplier.get().clear();
config = new AutoRefreshPluginConfigImpl();
IPluginConfig iPluginConfig = mock(IPluginConfig.class);
when(iPluginConfig.enabled()).thenReturn(true);
when(iPluginConfig.namespace()).thenReturn("mongodb");
when(iPluginConfig.domain()).thenReturn("observability");
config.onChange(null, iPluginConfig);
Context context = EaseAgent.getContext();
ContextUtils.setBeginTime(context);
MockEaseAgent.cleanLastSpan();
clusterId = new ClusterId("local-cluster");
serverAddress = new ServerAddress("127.0.0.1", 2020);
serverId = new ServerId(clusterId, serverAddress);
this.connectionDescription = new ConnectionDescription(serverId);
Map<String, Object> map = new HashMap<>();
map.put("collection", collection);
BsonDocument bsonDocument = BsonDocument.parse(JsonUtil.toJson(map));
this.startedEvent = new CommandStartedEvent(this.requestId, this.connectionDescription, this.dbName, this.cmdName, bsonDocument);
}
Aggregations