package com.atlassian.bitbucket.mesh;

import com.atlassian.bitbucket.mesh.test.context.DelegatingTestExecutionListener;
import org.hamcrest.Matcher;
import org.hamcrest.MatcherAssert;
import org.junit.Assert;
import org.junit.runner.RunWith;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import static com.atlassian.bitbucket.mesh.MeshConstants.PROFILE_SIDECAR;

@ActiveProfiles({PROFILE_SIDECAR}) //Required for MeshCoreWiring
@ContextConfiguration(classes = {MeshTestWiring.class, MeshCoreWiring.class})
@RunWith(SpringJUnit4ClassRunner.class)
@TestExecutionListeners(DelegatingTestExecutionListener.class)
public abstract class AbstractWiredTest extends Assert {

    // overrides the deprecated Assert.assertThat to get rid of deprecation warnings in subclasses
    public static <T> void assertThat(T actual, Matcher<? super T> matcher) {
        MatcherAssert.assertThat("", actual, matcher);
    }
}
