MongoClientDecorator implements TestClassDecorator { @Override public void beforeAll(final TestInvocation invocation) throws Exception { final ExecutionContext context = invocation.getContext(); final Configuration configuration = configurationRegistry.getConfiguration(context.getDescriptor()); final MongoClient client = new MongoClient(configuration.getServerAddresses(), configuration.getCredentials(), configuration.getClientOptions()); context.storeData(Constants.KEY_MONGO_CLIENT, client); }  @Override int getPriority(); @Override boolean isConfigurationSupported(final ExecutionContext ctx); @Override void beforeAll(final TestInvocation invocation); @Override void afterAll(final TestInvocation invocation);  }
@Test public void testBeforeTest() throws Throwable { decorator.beforeAll(invocation); verify(ctx).storeData(eq(Constants.KEY_MONGO_CLIENT), eq(mongoClient)); }