Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 372 for mock (0.17 sec)

  1. docs/en/docs/advanced/testing-dependencies.md

    This provider might be charging you per request, and calling it might take some extra time than if you had a fixed mock user for tests.
    
    You probably want to test the external provider once, but not necessarily call it for every test that runs.
    
    In this case, you can override the dependency that calls that provider, and use a custom dependency that returns a mock user, only for your tests.
    
    ### Use the `app.dependency_overrides` attribute
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  2. build-logic/documentation/src/test/groovy/gradlebuild/docs/model/SimpleClassMetaDataRepositoryTest.groovy

            TestDomainObject value1 = new TestDomainObject('a')
            TestDomainObject value2 = new TestDomainObject('a')
            repository.put('class1', value1)
            repository.put('class2', value2)
            Closure cl = Mock()
    
            when:
            repository.each(cl)
    
            then:
            1 * cl.call(['class1', value1] as Object[])
            1 * cl.call(['class2', value2] as Object[])
            0 * cl._
        }
    
    Groovy
    - Registered: Wed Apr 17 11:36:08 GMT 2024
    - Last Modified: Sat Apr 06 02:21:33 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  3. maven-compat/src/test/java/org/apache/maven/artifact/deployer/ArtifactDeployerTest.java

    import static org.codehaus.plexus.testing.PlexusExtension.getBasedir;
    import static org.junit.jupiter.api.Assertions.assertEquals;
    import static org.junit.jupiter.api.Assertions.assertTrue;
    import static org.mockito.Mockito.mock;
    
    /**
     */
    @Deprecated
    class ArtifactDeployerTest extends AbstractArtifactComponentTestCase {
        @Inject
        private ArtifactDeployer artifactDeployer;
    
        @Inject
        private SessionScope sessionScope;
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Thu Apr 25 05:46:50 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  4. maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java

    import static org.junit.jupiter.api.Assertions.assertFalse;
    import static org.junit.jupiter.api.Assertions.assertNotEquals;
    import static org.mockito.Mockito.mock;
    import static org.mockito.Mockito.verify;
    
    class DefaultToolchainTest {
        private final Logger logger = mock(Logger.class);
    
        @BeforeEach
        void setUp() throws Exception {
            MockitoAnnotations.initMocks(this);
        }
    
    Java
    - Registered: Sun Apr 28 03:35:10 GMT 2024
    - Last Modified: Fri Sep 22 09:07:17 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  5. maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java

    import org.eclipse.aether.DefaultRepositoryCache;
    import org.eclipse.aether.DefaultRepositorySystemSession;
    import org.eclipse.aether.RepositorySystem;
    import org.junit.jupiter.api.BeforeEach;
    
    import static org.mockito.Mockito.mock;
    
    /**
     */
    @PlexusTest
    public abstract class AbstractMavenProjectTestCase {
        protected ProjectBuilder projectBuilder;
    
        @Inject
        protected MavenRepositorySystem repositorySystem;
    
        @Inject
    Java
    - Registered: Sun Apr 28 03:35:10 GMT 2024
    - Last Modified: Fri Apr 12 10:50:18 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  6. maven-core/src/test/java/org/apache/maven/session/scope/SessionScopeProxyTest.java

    import org.codehaus.plexus.testing.PlexusTest;
    import org.eclipse.sisu.Typed;
    import org.junit.jupiter.api.Test;
    import org.junit.jupiter.api.extension.ExtendWith;
    import org.mockito.Mock;
    import org.mockito.junit.jupiter.MockitoExtension;
    
    import static org.junit.jupiter.api.Assertions.assertNotNull;
    import static org.junit.jupiter.api.Assertions.assertNotSame;
    Java
    - Registered: Sun Apr 28 03:35:10 GMT 2024
    - Last Modified: Tue Apr 23 12:52:20 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  7. istioctl/pkg/metrics/metrics_test.go

    	return promv1.AlertsResult{}, fmt.Errorf("TODO mockPromAPI doesn't mock Alerts")
    }
    
    func (client mockPromAPI) AlertManagers(ctx context.Context) (promv1.AlertManagersResult, error) {
    	return promv1.AlertManagersResult{}, fmt.Errorf("TODO mockPromAPI doesn't mock AlertManagers")
    }
    
    func (client mockPromAPI) CleanTombstones(ctx context.Context) error {
    	return nil
    }
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Wed Oct 25 02:07:44 GMT 2023
    - 7.9K bytes
    - Viewed (0)
  8. maven-compat/src/test/java/org/apache/maven/repository/legacy/WagonMock.java

     * specific language governing permissions and limitations
     * under the License.
     */
    package org.apache.maven.repository.legacy;
    
    import org.apache.maven.wagon.providers.file.FileWagon;
    
    /**
     * Mock of a Wagon for testing
     *
     */
    public class WagonMock extends FileWagon {
    
        /**
         * A field that can be configured in the Wagon
         *
         * @component.configuration default="configurableField"
         */
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Wed Sep 06 08:39:32 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  9. maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java

    import static org.junit.jupiter.api.Assertions.assertSame;
    import static org.junit.jupiter.api.Assertions.assertThrows;
    import static org.junit.jupiter.api.Assertions.assertTrue;
    import static org.mockito.Mockito.mock;
    
    /**
     */
    public class PluginParameterExpressionEvaluatorV4Test extends AbstractCoreMavenComponentTestCase {
        private static final String FS = File.separator;
    
        @Inject
        PlexusContainer container;
    
    Java
    - Registered: Sun Apr 28 03:35:10 GMT 2024
    - Last Modified: Mon Mar 25 10:50:01 GMT 2024
    - 19.2K bytes
    - Viewed (0)
  10. cni/pkg/nodeagent/cni-watcher_test.go

    		Status: corev1.PodStatus{
    			PodIP: fakePodIP,
    		},
    	}
    	ns := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "funkyns"}}
    
    	client := kube.NewFakeClient(ns, pod)
    
    	// We are expecting at most 1 calls to the mock, wait for them
    	wg, waitForMockCalls := NewWaitForNCalls(t, 1)
    	fs := &fakeServer{testWG: wg}
    
    	fs.On("AddPodToMesh",
    		ctx,
    		pod,
    		util.GetPodIPsIfPresent(pod),
    		valid.Netns,
    	).Return(nil)
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Feb 02 08:18:40 GMT 2024
    - 5.4K bytes
    - Viewed (0)
Back to top