use of com.yahoo.athenz.container.filter.ETagFilter in project athenz by yahoo.
the class ETagFilterTest method testRemoveLeadingAndTrailingQuotes.
@Test
public void testRemoveLeadingAndTrailingQuotes() {
ETagFilter eTagFilter = new ETagFilter();
assertEquals(eTagFilter.removeLeadingAndTrailingQuotes("abc"), "abc");
assertEquals(eTagFilter.removeLeadingAndTrailingQuotes("\"abc"), "abc");
assertEquals(eTagFilter.removeLeadingAndTrailingQuotes("abc\""), "abc");
assertEquals(eTagFilter.removeLeadingAndTrailingQuotes("\"abc\""), "abc");
assertEquals(eTagFilter.removeLeadingAndTrailingQuotes("\"a\"bc\""), "a\"bc");
}
use of com.yahoo.athenz.container.filter.ETagFilter in project athenz by yahoo.
the class ETagFilterTest method testFilterContainerETagSet.
@Test
public void testFilterContainerETagSet() {
ContainerResponseContext containerResponse = getContext("etag");
ETagFilter eTagFilter = new ETagFilter();
eTagFilter.filter(null, containerResponse);
EntityTag eTag = (EntityTag) containerResponse.getHeaders().getFirst(HttpHeaders.ETAG);
assertNotNull(eTag);
assertEquals(eTag.getValue(), "etag");
}
use of com.yahoo.athenz.container.filter.ETagFilter in project athenz by yahoo.
the class ETagFilterTest method testFilterContainerETagNotSet.
@Test
public void testFilterContainerETagNotSet() {
ContainerResponseContext containerResponse = getContext(null);
ETagFilter eTagFilter = new ETagFilter();
eTagFilter.filter(null, containerResponse);
EntityTag eTag = (EntityTag) containerResponse.getHeaders().getFirst(HttpHeaders.ETAG);
assertNull(eTag);
}
Aggregations