Package foo.domaintest.util

Examples of foo.domaintest.util.Memcache


  @Test
  public void testIntegration() throws Exception {
    StashAction stash = new StashAction();
    stash.response = new Response(sleeper, servletResponse, metrics);
    stash.memcache = new Memcache(null, metrics);
    StringWriter stashWriter = new StringWriter();
    when(servletResponse.getWriter()).thenReturn(new PrintWriter(stashWriter));
    stash.tempUrlFactory = new TempUrlFactory("http://testing.example/stash");
    stash.lazyRandomToken = lazy("token");
    stash.status = 234;
    stash.payload = "foo";
    stash.run();

    TempAction temp = new TempAction();
    temp.response = new Response(sleeper, servletResponse, metrics);
    temp.memcache = new Memcache(null, metrics);
    StringWriter tempWriter = new StringWriter();
    when(servletResponse.getWriter()).thenReturn(new PrintWriter(tempWriter));
    temp.requestPath = stashWriter.toString().replaceFirst(".*/", "");
    temp.run();
    verify(servletResponse).setStatus(234);
View Full Code Here


  @Rule public TestEnvironment env = new TestEnvironment(new LocalMemcacheServiceTestConfig());

  @Test
  public void testSavesAndReturnsToken() {
    TokenAction action = new TokenAction();
    action.memcache = new Memcache(null, mock(Metrics.class));
    action.response = new FakeResponse();
    action.randomToken = "token";
    action.run();
    assertEquals(
        new FakeResponse().setPayload("token"),
View Full Code Here

TOP

Related Classes of foo.domaintest.util.Memcache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.