Skip to content

Commit e8faa73

Browse files
author
eugenp
committed
testing cleanup
1 parent 84c71b3 commit e8faa73

6 files changed

Lines changed: 16 additions & 37 deletions

File tree

‎apache-poi/temp.xlsx‎

2 Bytes
Binary file not shown.

redis/src/test/java/com/baeldung/JedisTest.java renamed to redis/src/test/java/com/baeldung/JedisIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
import java.util.Map;
1111
import java.util.Set;
1212

13-
public class JedisTest {
13+
public class JedisIntegrationTest {
1414

1515
private Jedis jedis;
1616
private static RedisServer redisServer;
1717

18-
public JedisTest() {
18+
public JedisIntegrationTest() {
1919
jedis = new Jedis();
2020
}
2121

redis/src/test/java/com/baeldung/RedissonConfigurationTest.java renamed to redis/src/test/java/com/baeldung/RedissonConfigurationIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* Created by johnson on 3/9/17.
1616
*/
17-
public class RedissonConfigurationTest {
17+
public class RedissonConfigurationIntegrationTest {
1818
private static RedisServer redisServer;
1919
private static RedissonClient client;
2020

redis/src/test/java/com/baeldung/RedissonTest.java renamed to redis/src/test/java/com/baeldung/RedissonIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import static org.junit.Assert.assertEquals;
2424

25-
public class RedissonTest {
25+
public class RedissonIntegrationTest {
2626

2727
private static RedisServer redisServer;
2828
private static RedissonClient client;

spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointTest.java renamed to spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,45 @@
11
package com.baeldung.cachecontrol;
22

3-
import com.jayway.restassured.http.ContentType;
3+
import static com.jayway.restassured.RestAssured.given;
4+
45
import org.junit.Test;
56
import org.junit.runner.RunWith;
67
import org.springframework.boot.context.embedded.LocalServerPort;
78
import org.springframework.boot.test.context.SpringBootTest;
89
import org.springframework.test.context.junit4.SpringRunner;
910

10-
import static com.jayway.restassured.RestAssured.given;
11+
import com.jayway.restassured.http.ContentType;
1112

1213
@RunWith(SpringRunner.class)
1314
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = AppRunner.class)
14-
public class ResourceEndpointTest {
15+
public class ResourceEndpointIntegrationTest {
1516

1617
@LocalServerPort
1718
private int serverPort;
1819

1920
@Test
2021
public void whenGetRequestForUser_shouldRespondWithDefaultCacheHeaders() {
21-
given()
22-
.when()
23-
.get(getBaseUrl() + "/default/users/Michael")
24-
.then()
25-
.headers("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate")
26-
.header("Pragma", "no-cache");
22+
given().when().get(getBaseUrl() + "/default/users/Michael").then().headers("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate").header("Pragma", "no-cache");
2723
}
2824

2925
@Test
3026
public void whenGetRequestForUser_shouldRespondMaxAgeCacheControl() {
31-
given()
32-
.when()
33-
.get(getBaseUrl() + "/users/Michael")
34-
.then()
35-
.header("Cache-Control", "max-age=60");
27+
given().when().get(getBaseUrl() + "/users/Michael").then().header("Cache-Control", "max-age=60");
3628
}
3729

3830
@Test
3931
public void givenServiceEndpoint_whenGetRequestForUser_shouldResponseWithCacheControlMaxAge() {
40-
given()
41-
.when()
42-
.get(getBaseUrl() + "/users/Michael")
43-
.then()
44-
.contentType(ContentType.JSON).and().statusCode(200).and()
45-
.header("Cache-Control", "max-age=60");
32+
given().when().get(getBaseUrl() + "/users/Michael").then().contentType(ContentType.JSON).and().statusCode(200).and().header("Cache-Control", "max-age=60");
4633
}
4734

4835
@Test
4936
public void givenServiceEndpoint_whenGetRequestForNotCacheableContent_shouldResponseWithCacheControlNoCache() {
50-
given()
51-
.when()
52-
.get(getBaseUrl() + "/timestamp")
53-
.then()
54-
.contentType(ContentType.JSON).and().statusCode(200).and()
55-
.header("Cache-Control", "no-store");
37+
given().when().get(getBaseUrl() + "/timestamp").then().contentType(ContentType.JSON).and().statusCode(200).and().header("Cache-Control", "no-store");
5638
}
5739

5840
@Test
5941
public void givenServiceEndpoint_whenGetRequestForPrivateUser_shouldResponseWithSecurityDefaultCacheControl() {
60-
given()
61-
.when()
62-
.get(getBaseUrl() + "/private/users/Michael")
63-
.then()
64-
.contentType(ContentType.JSON).and().statusCode(200).and()
65-
.header("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate");
42+
given().when().get(getBaseUrl() + "/private/users/Michael").then().contentType(ContentType.JSON).and().statusCode(200).and().header("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate");
6643
}
6744

6845
private String getBaseUrl() {

‎struts2/pom.xml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.baeldung</groupId>
5-
<artifactId>MyStrutsApp</artifactId>
5+
<artifactId>struts</artifactId>
66
<version>0.0.1-SNAPSHOT</version>
77
<packaging>pom</packaging>
88
<name>struts</name>
9+
910
<build>
1011
<sourceDirectory>src/main/java</sourceDirectory>
1112
<resources>
1213
<resource>
1314
<directory>src/main/resources</directory>
1415
</resource>
1516
</resources>
17+
1618
<plugins>
1719
<plugin>
1820
<artifactId>maven-compiler-plugin</artifactId>

0 commit comments

Comments
 (0)