Browse Source

Add tests for controllers

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.4-alpha
Pekka Helenius 4 years ago
parent
commit
ec3bf519ed
4 changed files with 130 additions and 0 deletions
  1. +33
    -0
      bookstore/src/test/java/com/fjordtek/bookstore/web/dev/BookDevControllerTest.java
  2. +31
    -0
      bookstore/src/test/java/com/fjordtek/bookstore/web/json/BookRestControllerTest.java
  3. +33
    -0
      bookstore/src/test/java/com/fjordtek/bookstore/web/rest/BookBasePathAwareControllerTest.java
  4. +33
    -0
      bookstore/src/test/java/com/fjordtek/bookstore/web/webform/BookControllerTest.java

+ 33
- 0
bookstore/src/test/java/com/fjordtek/bookstore/web/dev/BookDevControllerTest.java View File

@ -0,0 +1,33 @@
// Pekka Helenius <fincer89@hotmail.com>, Fjordtek 2020
package com.fjordtek.bookstore.web.dev;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.fjordtek.bookstore.web.BookDevController;
/**
*
* TODO: N/A
*
* @author Pekka Helenius
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class BookDevControllerTest {
@Autowired
private BookDevController bookDevController;
@Test
public void contextLoads() throws Exception {
assertThat(bookDevController).isNotNull();
}
}

+ 31
- 0
bookstore/src/test/java/com/fjordtek/bookstore/web/json/BookRestControllerTest.java View File

@ -0,0 +1,31 @@
package com.fjordtek.bookstore.web.json;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.fjordtek.bookstore.web.BookRestController;
/**
*
* TODO: N/A
*
* @author Pekka Helenius
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class BookRestControllerTest {
@Autowired
private BookRestController bookRestController;
@Test
public void contextLoads() throws Exception {
assertThat(bookRestController).isNotNull();
}
}

+ 33
- 0
bookstore/src/test/java/com/fjordtek/bookstore/web/rest/BookBasePathAwareControllerTest.java View File

@ -0,0 +1,33 @@
// Pekka Helenius <fincer89@hotmail.com>, Fjordtek 2020
package com.fjordtek.bookstore.web.rest;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.fjordtek.bookstore.web.BookBasePathAwareController;
/**
*
* TODO: N/A
*
* @author Pekka Helenius
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class BookBasePathAwareControllerTest {
@Autowired
private BookBasePathAwareController bookBasePathAwareController;
@Test
public void contextLoads() throws Exception {
assertThat(bookBasePathAwareController).isNotNull();
}
}

+ 33
- 0
bookstore/src/test/java/com/fjordtek/bookstore/web/webform/BookControllerTest.java View File

@ -0,0 +1,33 @@
// Pekka Helenius <fincer89@hotmail.com>, Fjordtek 2020
package com.fjordtek.bookstore.web.webform;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.fjordtek.bookstore.web.BookController;
/**
*
* TODO: N/A
*
* @author Pekka Helenius
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class BookControllerTest {
@Autowired
private BookController bookController;
@Test
public void contextLoads() throws Exception {
assertThat(bookController).isNotNull();
}
}

Loading…
Cancel
Save