Search in sources :

Example 1 with CookieImpl

use of io.vertx.core.http.impl.CookieImpl in project java-chassis by ServiceComb.

the class CookieItemTest method serverFormattedElementOnNotFound.

@Test
public void serverFormattedElementOnNotFound() {
    HashMap<String, Cookie> cookieSet = new HashMap<>();
    CookieImpl cookie = new CookieImpl("anotherCookieName", COOKIE_VALUE);
    cookieSet.put(cookie.getName(), cookie);
    Mockito.when(mockContext.cookieCount()).thenReturn(1);
    Mockito.when(mockContext.cookieMap()).thenReturn(cookieSet);
    accessLogEvent.setRoutingContext(mockContext);
    ELEMENT.appendServerFormattedItem(accessLogEvent, strBuilder);
    Assert.assertEquals("-", strBuilder.toString());
}
Also used : Cookie(io.vertx.core.http.Cookie) CookieImpl(io.vertx.core.http.impl.CookieImpl) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 2 with CookieImpl

use of io.vertx.core.http.impl.CookieImpl in project java-chassis by ServiceComb.

the class CookieItemTest method serverFormattedElement.

@Test
public void serverFormattedElement() {
    HashMap<String, Cookie> cookieSet = new HashMap<>();
    CookieImpl cookie = new CookieImpl(COOKIE_NAME, COOKIE_VALUE);
    cookieSet.put(cookie.getName(), cookie);
    when(mockContext.cookieCount()).thenReturn(1);
    when(mockContext.cookieMap()).thenReturn(cookieSet);
    accessLogEvent.setRoutingContext(mockContext);
    ELEMENT.appendServerFormattedItem(accessLogEvent, strBuilder);
    Assert.assertEquals(COOKIE_VALUE, strBuilder.toString());
}
Also used : Cookie(io.vertx.core.http.Cookie) CookieImpl(io.vertx.core.http.impl.CookieImpl) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 3 with CookieImpl

use of io.vertx.core.http.impl.CookieImpl in project incubator-servicecomb-java-chassis by apache.

the class CookieItemTest method serverFormattedElementOnNotFound.

@Test
public void serverFormattedElementOnNotFound() {
    HashMap<String, Cookie> cookieSet = new HashMap<>();
    CookieImpl cookie = new CookieImpl("anotherCookieName", COOKIE_VALUE);
    cookieSet.put(cookie.getName(), cookie);
    Mockito.when(mockContext.cookieCount()).thenReturn(1);
    Mockito.when(mockContext.cookieMap()).thenReturn(cookieSet);
    accessLogEvent.setRoutingContext(mockContext);
    ELEMENT.appendServerFormattedItem(accessLogEvent, strBuilder);
    Assert.assertEquals("-", strBuilder.toString());
}
Also used : Cookie(io.vertx.core.http.Cookie) CookieImpl(io.vertx.core.http.impl.CookieImpl) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 4 with CookieImpl

use of io.vertx.core.http.impl.CookieImpl in project incubator-servicecomb-java-chassis by apache.

the class CookieItemTest method serverFormattedElement.

@Test
public void serverFormattedElement() {
    HashMap<String, Cookie> cookieSet = new HashMap<>();
    CookieImpl cookie = new CookieImpl(COOKIE_NAME, COOKIE_VALUE);
    cookieSet.put(cookie.getName(), cookie);
    when(mockContext.cookieCount()).thenReturn(1);
    when(mockContext.cookieMap()).thenReturn(cookieSet);
    accessLogEvent.setRoutingContext(mockContext);
    ELEMENT.appendServerFormattedItem(accessLogEvent, strBuilder);
    Assert.assertEquals(COOKIE_VALUE, strBuilder.toString());
}
Also used : Cookie(io.vertx.core.http.Cookie) CookieImpl(io.vertx.core.http.impl.CookieImpl) HashMap(java.util.HashMap) Test(org.junit.Test)

Aggregations

Cookie (io.vertx.core.http.Cookie)4 CookieImpl (io.vertx.core.http.impl.CookieImpl)4 HashMap (java.util.HashMap)4 Test (org.junit.Test)4