package cz.moneta.test.harness.endpoints;

/**
 * Endpoints are the the primary interface for interacting with the Harness library.
 * <p/>
 * They serve as unified wrappers around implementation details (i.e. native libraries), so, that no prior knowledge
 * of numerous system client libraries is required.
 * <p/>
 * Common endpoint would hold an instance of a single {@link cz.moneta.test.harness.connectors.Connector Connector}
 * responsible for the actual native client library interaction. Such connectors would include REST, WS, ORACLE or
 * Selenium ones.
 * <p/>
 * While implementing an endpoint for a new system, it is a good idea to find a similar endpoint harnessing the
 * same/required connector type. For example when implementing an endpoint for a new REST API, one
 * could start with modifying {@link cz.moneta.test.harness.endpoints.autoapi.AutoApiEndpoint AutoApiEndpoint}
 * or similar
 * <p/>
 * Some endpoints may require a new Connector implemented for a specific technology which is not handled by Harness yet
 * <p/>
 * Endpoints are usually instantiated inside a {@code harness.withSomeSystemName()} method which in turn calls
 * {@code harness.getEndpoint(SomeSystemEndpoint.class)}
 * <p/>
 * All endpoints instantiated via the {@link cz.moneta.test.harness.context.StoreAccessor#getEndpoint(Class, Object...)}
 * method are automatically closed (i.e. the resources are released) after each test
 */
public interface Endpoint {

    default boolean canAccess() {
        return true;
    }

    default void close() {
    }

}
