test_class.declarator: cookieHeaderSerializer
test_class.modifier: private static
test_class.original_string: private static CookieHeaderSerializer cookieHeaderSerializer;
test_class.type: CookieHeaderSerializer
test_class.var_name: cookieHeaderSerializer
test_class.declarator: dateProvider
test_class.modifier: private static
test_class.original_string: private static DateProvider dateProvider;
test_class.type: DateProvider
test_class.var_name: dateProvider
test_class.file: http/src/test/java/ro/polak/http/protocol/serializer/impl/CookieHeaderSerializerTest.java
test_class.identifier: CookieHeaderSerializerTest
test_case.body: @Test
      public void shouldSerializeExpiresBasedOnMaxAge() {
          int maxAgeSeconds = 35;
  
          Cookie cookie = new Cookie("name", "value");
          cookie.setMaxAge(maxAgeSeconds);
          String serializedCookie = cookieHeaderSerializer.serialize(cookie);
          Date date = new Date(System.currentTimeMillis() + Long.valueOf(maxAgeSeconds) * 1000L);
          String expiresValue = DateUtilities.dateFormat(date);
          assertThat(getExpiresValue(serializedCookie), is(expiresValue));
      }
test_case.class_method_signature: CookieHeaderSerializerTest.shouldSerializeExpiresBasedOnMaxAge()
test_case.full_signature: @Test public void shouldSerializeExpiresBasedOnMaxAge()
test_case.identifier: shouldSerializeExpiresBasedOnMaxAge
test_case.invocations: setMaxAge serialize currentTimeMillis valueOf dateFormat assertThat getExpiresValue is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldSerializeExpiresBasedOnMaxAge()
focal_class.declarator: SEPARATOR = "; "
focal_class.modifier: private static final
focal_class.original_string: private static final String SEPARATOR = "; ";
focal_class.type: String
focal_class.var_name: SEPARATOR
focal_class.declarator: EQUALS = "="
focal_class.modifier: private static final
focal_class.original_string: private static final String EQUALS = "=";
focal_class.type: String
focal_class.var_name: EQUALS
focal_class.declarator: MILLISECONDS_IN_SECOND = 1000L
focal_class.modifier: private static final
focal_class.original_string: private static final long MILLISECONDS_IN_SECOND = 1000L;
focal_class.type: long
focal_class.var_name: MILLISECONDS_IN_SECOND
focal_class.declarator: dateProvider
focal_class.modifier: private final
focal_class.original_string: private final DateProvider dateProvider;
focal_class.type: DateProvider
focal_class.var_name: dateProvider
focal_class.file: http/src/main/java/ro/polak/http/protocol/serializer/impl/CookieHeaderSerializer.java
focal_class.identifier: CookieHeaderSerializer
focal_class.interfaces: implements Serializer<Cookie>
focal_class.class_method_signature: CookieHeaderSerializer.CookieHeaderSerializer(final DateProvider dateProvider)
focal_class.full_signature: public  CookieHeaderSerializer(final DateProvider dateProvider)
focal_class.identifier: CookieHeaderSerializer
focal_class.modifiers: public
focal_class.parameters: (final DateProvider dateProvider)
focal_class.signature:  CookieHeaderSerializer(final DateProvider dateProvider)
focal_class.class_method_signature: CookieHeaderSerializer.serialize(final Cookie cookie)
focal_class.full_signature: @Override public String serialize(final Cookie cookie)
focal_class.identifier: serialize
focal_class.modifiers: @Override public
focal_class.parameters: (final Cookie cookie)
focal_class.return: String
focal_class.signature: String serialize(final Cookie cookie)
focal_class.class_method_signature: CookieHeaderSerializer.getExpires(final long maxAge)
focal_class.full_signature: private String getExpires(final long maxAge)
focal_class.identifier: getExpires
focal_class.modifiers: private
focal_class.parameters: (final long maxAge)
focal_class.return: String
focal_class.signature: String getExpires(final long maxAge)
focal_method.body: @Override
      public String serialize(final Cookie cookie) {
          StringBuilder sb = new StringBuilder();
          sb.append(cookie.getName())
                  .append(EQUALS)
                  .append(StringUtilities.urlEncode(cookie.getValue()));
  
          if (cookie.getMaxAge() != -1) {
              sb.append(SEPARATOR)
                      .append("Expires")
                      .append(EQUALS)
                      .append(getExpires(cookie.getMaxAge()));
          }
          if (cookie.getPath() != null) {
              sb.append(SEPARATOR)
                      .append("Path")
                      .append(EQUALS)
                      .append(cookie.getPath());
          }
          if (cookie.getDomain() != null) {
              sb.append(SEPARATOR)
                      .append("Domain")
                      .append(EQUALS)
                      .append(cookie.getDomain());
          }
          if (cookie.getComment() != null) {
              sb.append(SEPARATOR)
                      .append("Comment")
                      .append(EQUALS)
                      .append(cookie.getComment());
          }
          if (cookie.isHttpOnly()) {
              sb.append(SEPARATOR)
                      .append("HttpOnly");
          }
          if (cookie.isSecure()) {
              sb.append(SEPARATOR)
                      .append("Secure");
          }
  
          return sb.toString();
      }
focal_method.class_method_signature: CookieHeaderSerializer.serialize(final Cookie cookie)
focal_method.full_signature: @Override public String serialize(final Cookie cookie)
focal_method.identifier: serialize
focal_method.invocations: append append append getName urlEncode getValue getMaxAge append append append append getExpires getMaxAge getPath append append append append getPath getDomain append append append append getDomain getComment append append append append getComment isHttpOnly append append isSecure append append toString
focal_method.modifiers: @Override public
focal_method.parameters: (final Cookie cookie)
focal_method.return: String
focal_method.signature: String serialize(final Cookie cookie)