gpt4 book ai didi

org.rembx.jeeshop.rest.WebApplicationException类的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 15:13:05 25 4
gpt4 key购买 nike

本文整理了Java中org.rembx.jeeshop.rest.WebApplicationException类的一些代码示例,展示了WebApplicationException类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebApplicationException类的具体详情如下:
包路径:org.rembx.jeeshop.rest.WebApplicationException
类名称:WebApplicationException

WebApplicationException介绍

暂无

代码示例

代码示例来源:origin: remibantos/jeeshop

private void checkNotNull(Order order) {
  if (order == null) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

@Override
  public Response toResponse(WebApplicationException e) {
    return e.getResponse();
  }
}

代码示例来源:origin: remibantos/jeeshop

private void checkNotNull(Discount discount) {
  if (discount == null) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

@Test
public void delete_NotExistingEntry_shouldThrowNotFoundEx() {
  try {
    entityManager.getTransaction().begin();
    service.delete(666L);
    entityManager.getTransaction().commit();
    fail("should have thrown ex");
  } catch (WebApplicationException e) {
    assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

private void checkNotNull(MailTemplate mailTemplate) {
  if (mailTemplate == null) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

@Test
public void delete_NotExistingEntry_shouldThrowNotFoundEx() {
  try {
    entityManager.getTransaction().begin();
    service.delete(666L);
    entityManager.getTransaction().commit();
    fail("should have thrown ex");
  } catch (WebApplicationException e) {
    assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

private void checkNotNull(Catalog originalCatalog) {
  if (originalCatalog == null) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

@Test
public void delete_NotExistingEntry_shouldThrowNotFoundEx() {
  try {
    entityManager.getTransaction().begin();
    service.delete(666L);
    entityManager.getTransaction().commit();
    fail("should have thrown ex");
  } catch (WebApplicationException e) {
    assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

private void checkNotNull(User originalUser) {
  if (originalUser == null) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

@Test
public void delete_NotExistingEntry_shouldThrowNotFoundEx() {
  try {
    entityManager.getTransaction().begin();
    service.delete(666L);
    entityManager.getTransaction().commit();
    fail("should have thrown ex");
  } catch (WebApplicationException e) {
    assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

private void checkNotNull(Product product) {
    if (product == null) {
      throw new WebApplicationException(Response.Status.NOT_FOUND);
    }
  }
}

代码示例来源:origin: remibantos/jeeshop

@Test
public void activate_shouldThrowNotFoundExWhenUserIsNotFound() throws Exception {
  try {
    service.activate("unknown_login", UUID.randomUUID().toString());
    fail("should have thrown ex");
  } catch (WebApplicationException e) {
    assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

private void checkEntityNotNull() {
  if (presentation == null) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

@Test
public void delete_NotExistingEntry_shouldThrowNotFoundEx() {
  try {
    entityManager.getTransaction().begin();
    service.delete(666L);
    entityManager.getTransaction().commit();
    fail("should have thrown ex");
  } catch (WebApplicationException e) {
    assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

private void checkNotNull(SKU sku) {
  if (sku == null) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

@Test
public void sendTestEmail_shouldThrowNotFoundExWhenNoMailTemplateFoundForGivenParams() throws Exception {
  try {
    service.sendTestEmail(null, "unknown", "fr_FR", "toto@toto.com");
  } catch (WebApplicationException e) {
    assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.NOT_FOUND);
    return;
  }
  fail("Should have thrown NOT_FOUND WebApplicationException");
}

代码示例来源:origin: remibantos/jeeshop

private void checkNotNull(Category cat) {
  if (cat == null) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
}

代码示例来源:origin: remibantos/jeeshop

@Test
  public void delete_NotExistingEntry_shouldThrowNotFoundEx() {

    try {
      entityManager.getTransaction().begin();
      service.delete(666L);
      entityManager.getTransaction().commit();
      fail("should have thrown ex");
    } catch (WebApplicationException e) {
      assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.NOT_FOUND);
    }
  }
}

代码示例来源:origin: remibantos/jeeshop

@GET
@Path("/{customerId}")
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed({ADMIN, ADMIN_READONLY})
public User find(@PathParam("customerId") @NotNull Long customerId) {
  User user = entityManager.find(User.class, customerId);
  if (user == null) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
  return user;
}

代码示例来源:origin: remibantos/jeeshop

@Test
  public void delete_NotExistingEntry_shouldThrowNotFoundEx() {

    try {
      entityManager.getTransaction().begin();
      service.delete(666L);
      entityManager.getTransaction().commit();
      fail("should have thrown ex");
    } catch (WebApplicationException e) {
      assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.NOT_FOUND);
    }
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com