本文整理汇总了Java中org.springframework.orm.jpa.JpaObjectRetrievalFailureException类的典型用法代码示例。如果您正苦于以下问题:Java JpaObjectRetrievalFailureException类的具体用法?Java JpaObjectRetrievalFailureException怎么用?Java JpaObjectRetrievalFailureException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JpaObjectRetrievalFailureException类属于org.springframework.orm.jpa包,在下文中一共展示了JpaObjectRetrievalFailureException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: updateStorageUnknownInstance
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@Test(expected = JpaObjectRetrievalFailureException.class)
public void updateStorageUnknownInstance() {
final QuoteStorageEditionVo vo = new QuoteStorageEditionVo();
vo.setSubscription(subscription);
vo.setId(qsRepository.findByNameExpected("server1-root").getId());
vo.setName("server1-root-bis");
vo.setType("storage1");
vo.setQuoteInstance(-1);
vo.setSize(1);
sResource.update(vo);
}
开发者ID:ligoj,项目名称:plugin-prov,代码行数:12,代码来源:ProvQuoteStorageResourceTest.java
示例2: testCreateNoRole
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
/**
* test create service without a valid role.
*/
@Test(expected = JpaObjectRetrievalFailureException.class)
public void testCreateNoRole() {
final AuthorizationEditionVo authorization = new AuthorizationEditionVo();
authorization.setRole(-1);
authorization.setPattern("any");
resource.create(authorization);
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:11,代码来源:AuthorizationResourceTest.java
示例3: testUpdateNoRole
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
/**
* test update service without a valid role.
*/
@Test(expected = JpaObjectRetrievalFailureException.class)
public void testUpdateNoRole() {
final AuthorizationEditionVo authorization = new AuthorizationEditionVo();
authorization.setRole(-1);
authorization.setPattern("pattern");
resource.update(authorizationId, authorization);
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:11,代码来源:AuthorizationResourceTest.java
示例4: deleteAllExpectedFailed
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@Test(expected = JpaObjectRetrievalFailureException.class)
public void deleteAllExpectedFailed() {
final SystemDialect systemDialect = repository.findAll().get(1);
Assert.assertFalse(repository.findAll().isEmpty());
final List<Integer> list = new ArrayList<>();
list.add(systemDialect.getId());
list.add(-1);
repository.deleteAllExpected(list);
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:10,代码来源:RestRepositoryImplTest.java
示例5: should_getOne_retrieve_customers
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@Test
public void should_getOne_retrieve_customers() throws InterruptedException {
prepareTaskAs(() -> assertThat(catchExec(() -> repository.getOne(johnDoe.getId())))
.isInstanceOf(JpaObjectRetrievalFailureException.class), "Smith");
prepareTaskAs(() -> assertThat(repository.getOne(johnDoe.getId())).isEqualTo(johnDoe), "Doe");
prepareTaskAs(() -> assertThat(repository.getOne(aliceSmith.getId())).isEqualTo(aliceSmith), "Smith");
prepareTaskAs(() -> assertThat(catchExec(() -> repository.getOne(aliceSmith.getId())))
.isInstanceOf(JpaObjectRetrievalFailureException.class), "Doe");
waitForAssertions();
}
开发者ID:lordlothar99,项目名称:strategy-spring-security-acl,代码行数:11,代码来源:MultithreadCustomerRepositoryTest.java
示例6: deleteUnknown
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@Test(expected = JpaObjectRetrievalFailureException.class)
public void deleteUnknown() {
resource.delete(-1, false);
}
开发者ID:ligoj,项目名称:plugin-bt,代码行数:5,代码来源:BugTrackerResourceTest.java
示例7: findStorageTypeNotExistsSubscription
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@Test(expected = JpaObjectRetrievalFailureException.class)
public void findStorageTypeNotExistsSubscription() {
sResource.findType(-1, newUriInfo());
}
开发者ID:ligoj,项目名称:plugin-prov,代码行数:5,代码来源:ProvQuoteStorageResourceTest.java
示例8: findInstancePriceTermNotExistsSubscription
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@Test(expected = JpaObjectRetrievalFailureException.class)
public void findInstancePriceTermNotExistsSubscription() {
iResource.findPriceTerm(-1, newUriInfo());
}
开发者ID:ligoj,项目名称:plugin-prov,代码行数:5,代码来源:ProvQuoteInstanceResourceTest.java
示例9: findInstanceNotExistsSubscription
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@Test(expected = JpaObjectRetrievalFailureException.class)
public void findInstanceNotExistsSubscription() {
iResource.findAll(-1, newUriInfo());
}
开发者ID:ligoj,项目名称:plugin-prov,代码行数:5,代码来源:ProvQuoteInstanceResourceTest.java
示例10: uploadInvalidUsage
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
/**
* Expected usage does not exist at all.
*/
@Test(expected = JpaObjectRetrievalFailureException.class)
public void uploadInvalidUsage() throws IOException {
iResource.upload(subscription, new ByteArrayInputStream("ANY;0.5;500;LINUX;any".getBytes("UTF-8")),
new String[] { "name", "cpu", "ram", "os", "usage" }, "on-demand2", 1, "UTF-8");
}
开发者ID:ligoj,项目名称:plugin-prov,代码行数:9,代码来源:ProvQuoteInstanceResourceTest.java
示例11: findByIdInvalid
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
/**
* test {@link ContainerScopeResource#findById(int)}
*/
@Test(expected = JpaObjectRetrievalFailureException.class)
public void findByIdInvalid() {
Assert.assertNull(resource.findById(0));
}
开发者ID:ligoj,项目名称:plugin-id,代码行数:8,代码来源:ContainerScopeResourceTest.java
示例12: toResponse
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@Override
public Response toResponse(final JpaObjectRetrievalFailureException exception) {
return toResponseNotFound(exception.getCause());
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:5,代码来源:JpaObjectRetrievalFailureExceptionMapper.java
示例13: throwJpaObjectRetrievalFailureException
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@DELETE
@Path("jpaObjectRetrievalFailureException")
public void throwJpaObjectRetrievalFailureException() {
throw new JpaObjectRetrievalFailureException(new EntityNotFoundException("key"));
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:6,代码来源:ExceptionMapperResource.java
示例14: testFindByIdNotFound
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
/**
* test find by id service. Id is not in database
*/
@Test(expected = JpaObjectRetrievalFailureException.class)
public void testFindByIdNotFound() {
resource.findById(-1);
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:8,代码来源:RoleRessourceTest.java
示例15: testUpdateInvalidId
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
/**
* test update service without a valid identifier.
*/
@Test(expected = JpaObjectRetrievalFailureException.class)
public void testUpdateInvalidId() {
resource.update(-1, null);
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:8,代码来源:AuthorizationResourceTest.java
示例16: toResponse
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@Test
public void toResponse() {
final JpaObjectRetrievalFailureException exception = new JpaObjectRetrievalFailureException(new EntityNotFoundException("key"));
check(mock(new JpaObjectRetrievalFailureExceptionMapper()).toResponse(exception), 404,
"{\"code\":\"entity\",\"message\":\"key\",\"parameters\":null,\"cause\":null}");
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:7,代码来源:JpaObjectRetrievalFailureExceptionMapperTest.java
示例17: findOneExpectedError
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
/**
* Find one without expected result.
*/
@Test(expected = JpaObjectRetrievalFailureException.class)
public void findOneExpectedError() {
repository.findOneExpected(-1);
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:8,代码来源:RestRepositoryImplTest.java
示例18: findByNameExpectedError
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
/**
* Find by name without expected result.
*/
@Test(expected = JpaObjectRetrievalFailureException.class)
public void findByNameExpectedError() {
roleRepository.findByNameExpected("any");
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:8,代码来源:RestRepositoryImplTest.java
示例19: deleteNoFetchError
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@Test(expected = JpaObjectRetrievalFailureException.class)
public void deleteNoFetchError() {
SystemDialect systemDialect = repository.findAll().get(1);
repository.deleteNoFetch(systemDialect.getId());
repository.deleteNoFetch(systemDialect.getId());
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:7,代码来源:RestRepositoryImplTest.java
示例20: existExpectedFail
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException; //导入依赖的package包/类
@Test(expected = JpaObjectRetrievalFailureException.class)
public void existExpectedFail() {
repository.existExpected(-1);
}
开发者ID:ligoj,项目名称:bootstrap,代码行数:5,代码来源:RestRepositoryImplTest.java
注:本文中的org.springframework.orm.jpa.JpaObjectRetrievalFailureException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论