001package org.conqat.lib.commons.uniformpath; 002 003import java.util.Objects; 004 005import org.assertj.core.api.AbstractAssert; 006 007/** Custom asserts on RelativeUniformPath */ 008public class RelativeUniformPathAssert extends AbstractAssert<RelativeUniformPathAssert, RelativeUniformPath> { 009 010 private RelativeUniformPathAssert(RelativeUniformPath actual) { 011 super(actual, RelativeUniformPathAssert.class); 012 } 013 014 public static RelativeUniformPathAssert assertThat(RelativeUniformPath actual) { 015 return new RelativeUniformPathAssert(actual); 016 } 017 018 /** 019 * Asserts that the relative uniform path has the given string representation. 020 */ 021 public RelativeUniformPathAssert hasPath(String path) { 022 isNotNull(); 023 if (!Objects.equals(path, actual.toString())) { 024 failWithMessage("Expected path to be <%s> but was <%s>", path, actual.toString()); 025 } 026 return this; 027 } 028}