Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
public class IndexController {

public String index(){

return "index";
}

public String oupsHandler(){
return "notimplemented";
return "notimplemented_new";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package guru.springframework.sfgpetclinic.controllers;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

class IndexControllerTest {

IndexController controller;

// new_branch
@BeforeEach
void setUp() {
controller = new IndexController();
}

@Test
void index() {
assertEquals("index", controller.index());
assertEquals("index", controller.index(), "Wrong View Returned");

assertEquals("index", controller.index(),
() -> "Another Expensive Message " + "Make me only if you have to");
}

@Test
void oupsHandler() {
assertTrue("notimplemented".equals(controller.oupsHandler()),
() -> "This is some expensive " + "Message to build" + "for my test");
}
}