@Test
public void testMatch() {

    MonitorComponentConditional m = new MonitorComponentConditional();
    ConditionContext context = Mockito.mock(ConditionContext.class);
    MockEnvironment env = new MockEnvironment();
    env.setProperty("components.active", "metrics");
    when(context.getEnvironment()).thenReturn(env);
    AnnotatedTypeMetadata atm = Mockito.mock(AnnotatedTypeMetadata.class);
    MultiValueMap<String, Object> map = new LinkedMultiValueMap();
    map.put("value", Lists.newArrayList("metrics"));
    when(atm.getAllAnnotationAttributes(anyString())).thenReturn(map);
    Assert.assertTrue(m.matches(context, atm));
}