@Test
public void shouldBuildRepresentationForErrorMessage() {

    // given
    String someErrorProfile = "someErrorProfile";
    String someErrorMessage = "someErrorMessage";
    final ErrorHalRepresentationFactory factory = new ErrorHalRepresentationFactory(messageSource, new ObjectMapper(), someErrorProfile);
    // when
    ErrorHalRepresentation errorHalRepresentation = factory.halRepresentationForErrorMessage(someErrorMessage);
    // then
    assertThat(errorHalRepresentation.getErrors().isEmpty(), is(true));
    assertThat(errorHalRepresentation.getErrorMessage(), is(someErrorMessage));
    assertThat(errorHalRepresentation.getLinks().getLinkBy("profile").isPresent(), is(true));
    assertThat(errorHalRepresentation.getLinks().getLinkBy("profile").get().getHref(), is(someErrorProfile));
}