/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package hellogae;

import java.util.ArrayList;
import static org.junit.Assert.assertEquals;
import org.junit.Test;

/**
 *
 * @author valik
 */
public class GreetingsTest {
    @Test
    public void getGreeting() throws Exception {
       Greetings greetings = new Greetings();
       HelloGreeting helloGreeting0 = greetings.getGreeting(0);
       assertEquals("hello world!", helloGreeting0.getMessage());
       HelloGreeting helloGreeting1 = greetings.getGreeting(1);
       assertEquals("goodbye world!", helloGreeting1.getMessage());
    }
    
    @Test
    public void listGreeting() {
       Greetings greetings = new Greetings();
       ArrayList<HelloGreeting> helloGreetings = greetings.listGreeting();
       assertEquals(2, helloGreetings.size());
       assertEquals("hello world!", helloGreetings.get(0).getMessage());
       assertEquals("goodbye world!", helloGreetings.get(1).getMessage());
    }
    
    @Test
    public void insertGreeting() {
       HelloGreeting helloGreeting = new HelloGreeting("Test");
       Greetings greetings = new Greetings();
       HelloGreeting resultHelloGreeting = greetings.insertGreeting(2, helloGreeting);
       assertEquals("TestTest", resultHelloGreeting.getMessage());
    }

}

@@ -198,16 +198,121 @@
 logae;%0A%0A
+import com.google.api.server.spi.response.NotFoundException;%0Aimport com.google.appengine.api.users.User;%0A
 import j
@@ -331,16 +331,16 @@
 ayList;%0A
-
 import s
@@ -827,32 +827,226 @@
 ());%0A    %7D%0A    %0A
+    @Test(expected = NotFoundException.class)%0A    public void getGreetingException() throws Exception %7B%0A       Greetings greetings = new Greetings();%0A       greetings.getGreeting(2);%0A    %7D%0A    %0A
     @Test%0A    pu
@@ -1641,16 +1641,16 @@
 eting);%0A
-
        a
@@ -1713,12 +1713,319 @@
 );%0A    %7D
+%0A    %0A    @Test%0A    public void authedGreeting() %7B%0A        Greetings greetings = new Greetings();%0A        User user = new User(%22email@test.com%22, %22test.com%22);%0A        HelloGreeting helloGreeting = greetings.authedGreeting(user);%0A        assertEquals(%22hello email@test.com%22, helloGreeting.getMessage());%0A    %7D
 %0A%0A%7D%0A

Add more unit tests