File tree 12 files changed +36
-39
lines changed
lab1/complete/gradle/wrapper
lab2/library-server-initial
src/test/java/com/example/library/server
12 files changed +36
-39
lines changed Original file line number Diff line number Diff line change 1
1
distributionBase =GRADLE_USER_HOME
2
2
distributionPath =wrapper/dists
3
- distributionUrl =https\://services.gradle.org/distributions/gradle-5.2 .1-bin.zip
3
+ distributionUrl =https\://services.gradle.org/distributions/gradle-5.3 .1-bin.zip
4
4
zipStoreBase =GRADLE_USER_HOME
5
5
zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -28,16 +28,16 @@ APP_NAME="Gradle"
28
28
APP_BASE_NAME=` basename " $0 " `
29
29
30
30
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31
- DEFAULT_JVM_OPTS=" "
31
+ DEFAULT_JVM_OPTS=' "-Xmx64m" '
32
32
33
33
# Use the maximum available, or set MAX_FD != -1 to use that value.
34
34
MAX_FD=" maximum"
35
35
36
- warn ( ) {
36
+ warn () {
37
37
echo " $* "
38
38
}
39
39
40
- die ( ) {
40
+ die () {
41
41
echo
42
42
echo " $* "
43
43
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
155
155
fi
156
156
157
157
# Escape application args
158
- save ( ) {
158
+ save () {
159
159
for i do printf %s\\ n " $i " | sed " s/'/'\\\\ ''/g;1s/^/'/;\$ s/\$ /' \\\\ /" ; done
160
160
echo " "
161
161
}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
14
14
set APP_HOME = %DIRNAME%
15
15
16
16
@ rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17
- set DEFAULT_JVM_OPTS =
17
+ set DEFAULT_JVM_OPTS = " -Xmx64m "
18
18
19
19
@ rem Find java.exe
20
20
if defined JAVA_HOME goto findJavaFromJavaHome
Original file line number Diff line number Diff line change 1
1
distributionBase =GRADLE_USER_HOME
2
2
distributionPath =wrapper/dists
3
- distributionUrl =https\://services.gradle.org/distributions/gradle-5.2 .1-bin.zip
3
+ distributionUrl =https\://services.gradle.org/distributions/gradle-5.3 .1-bin.zip
4
4
zipStoreBase =GRADLE_USER_HOME
5
5
zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -6,11 +6,10 @@ buildscript {
6
6
7
7
plugins {
8
8
id ' org.springframework.boot' version ' 2.1.4.RELEASE'
9
- id ' org.asciidoctor.convert' version ' 1.5.9.2 '
9
+ id ' org.asciidoctor.convert' version ' 1.5.6 '
10
10
id ' java'
11
11
}
12
12
13
- apply plugin : ' org.springframework.boot'
14
13
apply plugin : ' io.spring.dependency-management'
15
14
16
15
group = ' com.example'
@@ -23,9 +22,11 @@ repositories {
23
22
24
23
test {
25
24
useJUnitPlatform()
25
+ outputs. dir snippetsDir
26
26
}
27
27
28
28
asciidoctor {
29
+ inputs. dir snippetsDir
29
30
setOptions([
30
31
' doctype' : ' book' ,
31
32
' backend' : ' html5'
@@ -40,13 +41,6 @@ asciidoctor {
40
41
dependsOn test
41
42
}
42
43
43
- bootJar {
44
- dependsOn test, asciidoctor
45
- from(" ${ asciidoctor.outputDir} /html5" ) {
46
- into ' BOOT-INF/classes/static/docs'
47
- }
48
- }
49
-
50
44
dependencies {
51
45
implementation(' org.springframework.boot:spring-boot-starter-actuator' )
52
46
implementation(' org.springframework.boot:spring-boot-starter-data-jpa' )
Original file line number Diff line number Diff line change 1
1
distributionBase =GRADLE_USER_HOME
2
2
distributionPath =wrapper/dists
3
- distributionUrl =https\://services.gradle.org/distributions/gradle-5.2 .1-bin.zip
3
+ distributionUrl =https\://services.gradle.org/distributions/gradle-5.3 .1-bin.zip
4
4
zipStoreBase =GRADLE_USER_HOME
5
5
zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -28,16 +28,16 @@ APP_NAME="Gradle"
28
28
APP_BASE_NAME=` basename " $0 " `
29
29
30
30
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31
- DEFAULT_JVM_OPTS=" "
31
+ DEFAULT_JVM_OPTS=' "-Xmx64m" '
32
32
33
33
# Use the maximum available, or set MAX_FD != -1 to use that value.
34
34
MAX_FD=" maximum"
35
35
36
- warn ( ) {
36
+ warn () {
37
37
echo " $* "
38
38
}
39
39
40
- die ( ) {
40
+ die () {
41
41
echo
42
42
echo " $* "
43
43
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
155
155
fi
156
156
157
157
# Escape application args
158
- save ( ) {
158
+ save () {
159
159
for i do printf %s\\ n " $i " | sed " s/'/'\\\\ ''/g;1s/^/'/;\$ s/\$ /' \\\\ /" ; done
160
160
echo " "
161
161
}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
14
14
set APP_HOME = %DIRNAME%
15
15
16
16
@ rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17
- set DEFAULT_JVM_OPTS =
17
+ set DEFAULT_JVM_OPTS = " -Xmx64m "
18
18
19
19
@ rem Find java.exe
20
20
if defined JAVA_HOME goto findJavaFromJavaHome
Original file line number Diff line number Diff line change
1
+ pluginManagement {
2
+ repositories {
3
+ gradlePluginPortal()
4
+ }
5
+ }
1
6
rootProject. name = ' library-server-initial'
Original file line number Diff line number Diff line change 14
14
import org .springframework .restdocs .RestDocumentationExtension ;
15
15
import org .springframework .security .test .context .support .WithMockUser ;
16
16
import org .springframework .security .test .context .support .WithUserDetails ;
17
+ import org .springframework .test .annotation .DirtiesContext ;
17
18
import org .springframework .test .context .junit .jupiter .SpringExtension ;
18
19
import org .springframework .test .web .servlet .MockMvc ;
19
20
import org .springframework .test .web .servlet .setup .MockMvcBuilders ;
33
34
34
35
@ ExtendWith ({RestDocumentationExtension .class , SpringExtension .class })
35
36
@ SpringBootTest
37
+ @ DirtiesContext
36
38
@ DisplayName ("Verify book api can" )
37
39
class BookApiIntegrationTests {
38
40
Original file line number Diff line number Diff line change 13
13
import org .springframework .restdocs .RestDocumentationContextProvider ;
14
14
import org .springframework .restdocs .RestDocumentationExtension ;
15
15
import org .springframework .restdocs .mockmvc .RestDocumentationRequestBuilders ;
16
+ import org .springframework .test .annotation .DirtiesContext ;
16
17
import org .springframework .test .context .junit .jupiter .SpringExtension ;
17
18
import org .springframework .test .web .servlet .MockMvc ;
18
19
import org .springframework .test .web .servlet .setup .MockMvcBuilders ;
31
32
32
33
@ ExtendWith ({RestDocumentationExtension .class , SpringExtension .class })
33
34
@ SpringBootTest
35
+ @ DirtiesContext
34
36
@ DisplayName ("Verify user api can" )
35
37
class UserApiIntegrationTests {
36
38
Original file line number Diff line number Diff line change @@ -25,25 +25,19 @@ void create() {}
25
25
@ Test
26
26
void update () {}
27
27
28
- @ Nested
29
- @ DisplayName ("User is authorized to find a book" )
30
- class findByIdentifierAuthorized {
31
-
32
- @ WithMockUser
33
- @ Test
34
- @ DisplayName ("for USER role" )
35
- void findByIdentifierIsAuthorizedForRoleUser () {
36
- assertThat (cut .findByIdentifier (DataInitializer .BOOK_CLEAN_CODE_IDENTIFIER )).isPresent ();
37
- }
38
-
39
- @ WithMockUser (roles = "CURATOR" )
40
- @ Test
41
- @ DisplayName ("for CURATOR role" )
42
- void findByIdentifierIsAuthorizedForRoleCurator () {
43
- assertThat (cut .findByIdentifier (DataInitializer .BOOK_CLEAN_CODE_IDENTIFIER )).isPresent ();
44
- }
28
+ @ WithMockUser
29
+ @ Test
30
+ @ DisplayName ("for USER role" )
31
+ void findByIdentifierIsAuthorizedForRoleUser () {
32
+ assertThat (cut .findByIdentifier (DataInitializer .BOOK_CLEAN_CODE_IDENTIFIER )).isPresent ();
45
33
}
46
34
35
+ @ WithMockUser (roles = "CURATOR" )
36
+ @ Test
37
+ @ DisplayName ("for CURATOR role" )
38
+ void findByIdentifierIsAuthorizedForRoleCurator () {
39
+ assertThat (cut .findByIdentifier (DataInitializer .BOOK_CLEAN_CODE_IDENTIFIER )).isPresent ();
40
+ }
47
41
48
42
@ Test
49
43
void findWithDetailsByIdentifier () {}
You can’t perform that action at this time.
0 commit comments