// Path: linkshortener-api/src/main/java/be/drissamri/service/exception/InvalidURLException.java
// public class InvalidURLException extends LinkshortenerException {
// 
//   public InvalidURLException(String message) {
//     super(message);
//   }
// 
//   public InvalidURLException(String message, Throwable cause) {
//     super(message, cause);
//   }
// }
// 
// Path: linkshortener-api/src/main/java/be/drissamri/service/impl/Base36HashService.java
// @Service
// public class Base36HashService implements HashService {
//   private static final int RADIX = 36;
//   private static final String PIPE = "-";
// 
//   @Override
//   public String shorten(String url) {
//     return encode(url);
//   }
// 
//   private String encode(String url) {
//     if (StringUtils.isEmpty(url)) {
//       throw new InvalidURLException("Supplied invalid url: empty");
//     }
// 
//     boolean isSupportedProtocol = SupportedProtocol.contains(url);
//     if (!isSupportedProtocol) {
//       throw new InvalidURLException("URL protocol not supported");
//     }
// 
//     String hexValue = Integer.toString(url.hashCode(), RADIX);
//     if (hexValue.startsWith(PIPE)) {
//       hexValue = hexValue.substring(1);
//     }
// 
//     // TODO: Implement database check to prevent collisions
//     return hexValue;
//   }
// 
// }


import be.drissamri.service.exception.InvalidURLException;
import be.drissamri.service.impl.Base36HashService;
import org.junit.Ignore;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
package be.drissamri.service;



@Ignore
public class Base36HashServiceTest {
  private Base36HashService base36ShortenService = new Base36HashService();

  @Test
  public void validHttpUrlShouldReturnAHash() {
    String result = base36ShortenService.shorten("http://www.drissamri.be");

    assertThat(result).isEqualTo("miufvo");
  }

  @Test
  public void validHttpsUrlShouldReturnAHash() {
    String result = base36ShortenService.shorten("https://www.drissamri.be");

    assertThat(result).isEqualTo("3yq02h");
  }

// Path: linkshortener-api/src/main/java/be/drissamri/service/exception/InvalidURLException.java
// public class InvalidURLException extends LinkshortenerException {
// 
//   public InvalidURLException(String message) {
//     super(message);
//   }
// 
//   public InvalidURLException(String message, Throwable cause) {
//     super(message, cause);
//   }
// }
// 
// Path: linkshortener-api/src/main/java/be/drissamri/service/impl/Base36HashService.java
// @Service
// public class Base36HashService implements HashService {
//   private static final int RADIX = 36;
//   private static final String PIPE = "-";
// 
//   @Override
//   public String shorten(String url) {
//     return encode(url);
//   }
// 
//   private String encode(String url) {
//     if (StringUtils.isEmpty(url)) {
//       throw new InvalidURLException("Supplied invalid url: empty");
//     }
// 
//     boolean isSupportedProtocol = SupportedProtocol.contains(url);
//     if (!isSupportedProtocol) {
//       throw new InvalidURLException("URL protocol not supported");
//     }
// 
//     String hexValue = Integer.toString(url.hashCode(), RADIX);
//     if (hexValue.startsWith(PIPE)) {
//       hexValue = hexValue.substring(1);
//     }
// 
//     // TODO: Implement database check to prevent collisions
//     return hexValue;
//   }
// 
// }


// Path: linkshortener-api/src/test/java/be/drissamri/service/Base36HashServiceTest.java
import be.drissamri.service.exception.InvalidURLException;
import be.drissamri.service.impl.Base36HashService;
import org.junit.Ignore;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;

package be.drissamri.service;



@Ignore
public class Base36HashServiceTest {
  private Base36HashService base36ShortenService = new Base36HashService();

  @Test
  public void validHttpUrlShouldReturnAHash() {
    String result = base36ShortenService.shorten("http://www.drissamri.be");

    assertThat(result).isEqualTo("miufvo");
  }

  @Test
  public void validHttpsUrlShouldReturnAHash() {
    String result = base36ShortenService.shorten("https://www.drissamri.be");

    assertThat(result).isEqualTo("3yq02h");
  }

  @Test(expected = InvalidURLException.class)