Java Code Examples for org.example.ws.model.Greeting#setId()

The following examples show how to use org.example.ws.model.Greeting#setId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GreetingServiceTest.java    From spring-security-fundamentals with Apache License 2.0 8 votes vote down vote up
@Test
public void testUpdateNotFound() {

    Exception exception = null;

    Greeting entity = new Greeting();
    entity.setId(Long.MAX_VALUE);
    entity.setText("test");

    try {
        service.update(entity);
    } catch (NoResultException e) {
        exception = e;
    }

    Assert.assertNotNull("failure - expected exception", exception);
    Assert.assertTrue("failure - expected NoResultException",
            exception instanceof NoResultException);

}
 
Example 2
Source File: GreetingServiceTest.java    From spring-data-fundamentals with Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateWithId() {

    Exception exception = null;

    Greeting entity = new Greeting();
    entity.setId(Long.MAX_VALUE);
    entity.setText("test");

    try {
        service.create(entity);
    } catch (EntityExistsException e) {
        exception = e;
    }

    Assert.assertNotNull("failure - expected exception", exception);
    Assert.assertTrue("failure - expected EntityExistsException",
            exception instanceof EntityExistsException);

}
 
Example 3
Source File: GreetingServiceTest.java    From spring-data-fundamentals with Apache License 2.0 6 votes vote down vote up
@Test
public void testUpdateNotFound() {

    Exception exception = null;

    Greeting entity = new Greeting();
    entity.setId(Long.MAX_VALUE);
    entity.setText("test");

    try {
        service.update(entity);
    } catch (NoResultException e) {
        exception = e;
    }

    Assert.assertNotNull("failure - expected exception", exception);
    Assert.assertTrue("failure - expected NoResultException",
            exception instanceof NoResultException);

}
 
Example 4
Source File: GreetingServiceTest.java    From spring-boot-fundamentals with Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateWithId() {

    Exception exception = null;

    Greeting entity = new Greeting();
    entity.setId(Long.MAX_VALUE);
    entity.setText("test");

    try {
        service.create(entity);
    } catch (EntityExistsException e) {
        exception = e;
    }

    Assert.assertNotNull("failure - expected exception", exception);
    Assert.assertTrue("failure - expected EntityExistsException",
            exception instanceof EntityExistsException);

}
 
Example 5
Source File: GreetingServiceTest.java    From spring-boot-fundamentals with Apache License 2.0 6 votes vote down vote up
@Test
public void testUpdateNotFound() {

    Exception exception = null;

    Greeting entity = new Greeting();
    entity.setId(Long.MAX_VALUE);
    entity.setText("test");

    try {
        service.update(entity);
    } catch (NoResultException e) {
        exception = e;
    }

    Assert.assertNotNull("failure - expected exception", exception);
    Assert.assertTrue("failure - expected NoResultException",
            exception instanceof NoResultException);

}
 
Example 6
Source File: GreetingServiceTest.java    From spring-security-fundamentals with Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateWithId() {

    Exception exception = null;

    Greeting entity = new Greeting();
    entity.setId(Long.MAX_VALUE);
    entity.setText("test");

    try {
        service.create(entity);
    } catch (EntityExistsException e) {
        exception = e;
    }

    Assert.assertNotNull("failure - expected exception", exception);
    Assert.assertTrue("failure - expected EntityExistsException",
            exception instanceof EntityExistsException);

}
 
Example 7
Source File: GreetingControllerMocksTest.java    From spring-data-fundamentals with Apache License 2.0 4 votes vote down vote up
private Greeting getEntityStubData() {
    Greeting entity = new Greeting();
    entity.setId(1L);
    entity.setText("hello");
    return entity;
}
 
Example 8
Source File: GreetingControllerMocksTest.java    From spring-boot-fundamentals with Apache License 2.0 4 votes vote down vote up
private Greeting getEntityStubData() {
    Greeting entity = new Greeting();
    entity.setId(1L);
    entity.setText("hello");
    return entity;
}
 
Example 9
Source File: GreetingControllerMocksTest.java    From spring-security-fundamentals with Apache License 2.0 4 votes vote down vote up
private Greeting getEntityStubData() {
    Greeting entity = new Greeting();
    entity.setId(1L);
    entity.setText("hello");
    return entity;
}