-
Notifications
You must be signed in to change notification settings - Fork 54.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build optimization 10.06.2017 (#2037)
* Refactor * Refactor
- Loading branch information
Showing
11 changed files
with
65 additions
and
133 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
core-java/src/main/java/com/baeldung/serialization/Address.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.baeuldung.serialization; | ||
package com.baeldung.serialization; | ||
|
||
public class Address { | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
core-java/src/main/java/com/baeldung/serialization/Employee.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
core-java/src/test/java/com/baeldung/serialization/PersonUnitTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...st/Spring5ApplicationIntegrationTest.java → ...ng/Spring5ApplicationIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 51 additions & 53 deletions
104
...test/java/com/baeldung/test/LiveTest.java → ...rc/test/kotlin/com/baeldung/LiveTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,52 @@ | ||
package com.baeldung.test; | ||
|
||
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; | ||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
import org.springframework.http.MediaType; | ||
|
||
import com.jayway.restassured.RestAssured; | ||
import com.jayway.restassured.response.Response; | ||
import com.jayway.restassured.specification.RequestSpecification; | ||
|
||
public class LiveTest { | ||
|
||
private static String APP_ROOT = "http://localhost:8081"; | ||
|
||
|
||
@Test | ||
public void givenUser_whenResourceCreatedWithNullName_then400BadRequest() { | ||
final Response response = givenAuth("user", "pass").contentType(MediaType.APPLICATION_JSON.toString()).body(resourceWithNullName()).post(APP_ROOT + "/foos"); | ||
assertEquals(400, response.getStatusCode()); | ||
} | ||
|
||
@Test | ||
public void givenUser_whenResourceCreated_then201Created() { | ||
final Response response = givenAuth("user", "pass").contentType(MediaType.APPLICATION_JSON.toString()).body(resourceString()).post(APP_ROOT + "/foos"); | ||
assertEquals(201, response.getStatusCode()); | ||
} | ||
|
||
/*@Test | ||
public void givenUser_whenGetAllFoos_thenOK() { | ||
final Response response = givenAuth("user", "pass").get(APP_ROOT + "/foos"); | ||
assertEquals(200, response.getStatusCode()); | ||
}*/ | ||
|
||
|
||
|
||
// | ||
|
||
private final String resourceWithNullName() { | ||
final String roleData = "{\"name\":null}"; | ||
return roleData; | ||
} | ||
|
||
private final String resourceString() { | ||
final String roleData = "{\"name\":\"" + randomAlphabetic(8) + "\"}"; | ||
return roleData; | ||
} | ||
|
||
private final RequestSpecification givenAuth(String username, String password) { | ||
return RestAssured.given().auth().preemptive().basic(username, password); | ||
} | ||
|
||
package com.baeldung; | ||
|
||
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; | ||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
import org.springframework.http.MediaType; | ||
|
||
import com.jayway.restassured.RestAssured; | ||
import com.jayway.restassured.response.Response; | ||
import com.jayway.restassured.specification.RequestSpecification; | ||
|
||
public class LiveTest { | ||
|
||
private static String APP_ROOT = "http://localhost:8081"; | ||
|
||
|
||
@Test | ||
public void givenUser_whenResourceCreatedWithNullName_then400BadRequest() { | ||
final Response response = givenAuth("user", "pass").contentType(MediaType.APPLICATION_JSON.toString()).body(resourceWithNullName()).post(APP_ROOT + "/foos"); | ||
assertEquals(400, response.getStatusCode()); | ||
} | ||
|
||
@Test | ||
public void givenUser_whenResourceCreated_then201Created() { | ||
final Response response = givenAuth("user", "pass").contentType(MediaType.APPLICATION_JSON.toString()).body(resourceString()).post(APP_ROOT + "/foos"); | ||
assertEquals(201, response.getStatusCode()); | ||
} | ||
|
||
/*@Test | ||
public void givenUser_whenGetAllFoos_thenOK() { | ||
final Response response = givenAuth("user", "pass").get(APP_ROOT + "/foos"); | ||
assertEquals(200, response.getStatusCode()); | ||
}*/ | ||
|
||
|
||
|
||
// | ||
|
||
private final String resourceWithNullName() { | ||
return "{\"name\":null}"; | ||
} | ||
|
||
private final String resourceString() { | ||
return "{\"name\":\"" + randomAlphabetic(8) + "\"}"; | ||
} | ||
|
||
private final RequestSpecification givenAuth(String username, String password) { | ||
return RestAssured.given().auth().preemptive().basic(username, password); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 0 additions & 61 deletions
61
...curity-mvc-boot/src/test/java/org/baeldung/web/MultipleAuthProvidersApplicationTests.java
This file was deleted.
Oops, something went wrong.