
com.fitbur.testify.integration.IntegrationTestVerifier Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2015 Sharmarke Aden.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.fitbur.testify.integration;
import static com.fitbur.guava.common.base.Preconditions.checkState;
import com.fitbur.testify.TestContext;
import com.fitbur.testify.TestVerifier;
import com.fitbur.testify.descriptor.CutDescriptor;
import com.fitbur.testify.descriptor.FieldDescriptor;
import com.fitbur.testify.descriptor.ParameterDescriptor;
import com.fitbur.testify.need.Need;
import static java.lang.Class.forName;
import static java.lang.reflect.Modifier.isFinal;
import static java.security.AccessController.doPrivileged;
import java.security.PrivilegedAction;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import org.slf4j.Logger;
/**
* An integration test verifier that inspects the test context descriptors to
* make sure everything is properly configured before test class injection is
* performed and everything is wired correctly after test class injection is
* performed.
*
* @author saden
*/
public class IntegrationTestVerifier implements TestVerifier {
private final TestContext testContext;
private final Logger logger;
public IntegrationTestVerifier(TestContext context, Logger logger) {
this.testContext = context;
this.logger = logger;
}
@Override
public void dependency() {
doPrivileged((PrivilegedAction
© 2015 - 2025 Weber Informatics LLC | Privacy Policy