From 74509557a6a47f07b9751bc9a2f7b466d765eb59 Mon Sep 17 00:00:00 2001 From: jesus-dayo Date: Thu, 11 Aug 2016 10:04:27 +0800 Subject: [PATCH] remove StudentDirectory --- .../src/main/resources/application.properties | 1 - .../web/service/StudentServiceTest.java | 49 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 spring-rest-angular-pagination/StudentDirectory/src/main/resources/application.properties delete mode 100644 spring-rest-angular-pagination/StudentDirectory/src/test/java/org/baeldung/web/service/StudentServiceTest.java diff --git a/spring-rest-angular-pagination/StudentDirectory/src/main/resources/application.properties b/spring-rest-angular-pagination/StudentDirectory/src/main/resources/application.properties deleted file mode 100644 index e42588cee0..0000000000 --- a/spring-rest-angular-pagination/StudentDirectory/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -server.contextPath=/ \ No newline at end of file diff --git a/spring-rest-angular-pagination/StudentDirectory/src/test/java/org/baeldung/web/service/StudentServiceTest.java b/spring-rest-angular-pagination/StudentDirectory/src/test/java/org/baeldung/web/service/StudentServiceTest.java deleted file mode 100644 index c6c9539abd..0000000000 --- a/spring-rest-angular-pagination/StudentDirectory/src/test/java/org/baeldung/web/service/StudentServiceTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.baeldung.web.service; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.apache.commons.lang3.RandomStringUtils; -import org.baeldung.web.main.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; - -import io.restassured.RestAssured; -import io.restassured.response.Response; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = Application.class) -@WebAppConfiguration -@IntegrationTest("server.port:8080") -public class StudentServiceTest{ - - private String getURL() { - return "/student/get"; - } - - @Test - public void whenResourcesAreRetrievedPaged_then200IsReceived(){ - Response response = RestAssured.given().get(getURL()+ "?page=0&size=2").andReturn(); - - assertTrue(response.getStatusCode() == 200 ); - } - - @Test - public void whenPageOfResourcesAreRetrievedOutOfBounds_then404IsReceived(){ - String url = getURL()+ "?page=" + RandomStringUtils.randomNumeric(5) + "&size=2"; - Response response = RestAssured.given().get(url); - - assertTrue(response.getStatusCode() == 500 ); - } - - @Test - public void givenResourcesExist_whenFirstPageIsRetrieved_thenPageContainsResources(){ - Response response = RestAssured.given().get(getURL() + "?page=1&size=2" ); - assertFalse(response.getBody().jsonPath().getList("content").isEmpty() ); - } - -}