Skip to content

Commit 64669a0

Browse files
authored
Merge pull request #62 from saurabhpro/renovate/all
Update Renovate Dependency Scan
2 parents b2ee95f + 02c5310 commit 64669a0

File tree

12 files changed

+155
-155
lines changed

12 files changed

+155
-155
lines changed

JavaCon/JsonIO/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<dependency>
2020
<groupId>com.fasterxml.jackson.core</groupId>
2121
<artifactId>jackson-databind</artifactId>
22-
<version>2.12.5</version>
22+
<version>2.13.0</version>
2323
</dependency>
2424
<dependency>
2525
<groupId>commons-io</groupId>

JavaCon/SpecialKeywords/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<dependency>
2020
<groupId>org.openjfx</groupId>
2121
<artifactId>javafx-controls</artifactId>
22-
<version>17.0.0.1</version>
22+
<version>17.0.1</version>
2323
</dependency>
2424

2525
</dependencies>

JavaCon/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<lombok.version>1.18.22</lombok.version>
3333
<commons-io.version>2.11.0</commons-io.version>
34-
<rxjava.version>3.1.1</rxjava.version>
34+
<rxjava.version>3.1.2</rxjava.version>
3535
</properties>
3636

3737
<dependencies>

Playground/pom.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
<dependency>
2020
<groupId>com.fasterxml.jackson.dataformat</groupId>
2121
<artifactId>jackson-dataformat-yaml</artifactId>
22-
<version>2.12.4</version>
22+
<version>2.13.0</version>
2323
</dependency>
2424
<dependency>
2525
<groupId>com.fasterxml.jackson.core</groupId>
2626
<artifactId>jackson-databind</artifactId>
27-
<version>2.12.4</version>
27+
<version>2.13.0</version>
2828
</dependency>
2929

3030
<dependency>
3131
<groupId>org.immutables</groupId>
3232
<artifactId>value</artifactId>
33-
<version>2.8.2</version>
33+
<version>2.8.9-ea-1</version>
3434
<scope>provided</scope>
3535
</dependency>
3636
<dependency>
@@ -46,7 +46,7 @@
4646
<dependency>
4747
<groupId>org.junit.jupiter</groupId>
4848
<artifactId>junit-jupiter-engine</artifactId>
49-
<version>5.7.2</version>
49+
<version>5.8.1</version>
5050
<scope>compile</scope>
5151
</dependency>
5252

Testing/Mockito/src/test/java/ListTest.java

+79-79
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
import static org.hamcrest.CoreMatchers.is;
1414
import static org.junit.Assert.*;
15-
import static org.mockito.Matchers.anyInt;
16-
import static org.mockito.Matchers.eq;
15+
import static org.mockito.ArgumentMatchers.anyInt;
16+
import static org.mockito.ArgumentMatchers.eq;
1717
import static org.mockito.Mockito.when;
1818

1919
/**
@@ -39,81 +39,81 @@
3939
*/
4040

4141
public class ListTest {
42-
@Rule
43-
public MockitoRule mockitoRule = MockitoJUnit.rule(); //Use this instead of RunWith(jUnitRunner)
44-
45-
@Mock
46-
private List<String> list;
47-
48-
@Test
49-
public void letsMockListSize() {
50-
when(list.size()).thenReturn(10);
51-
52-
//THEN
53-
assertEquals(10, list.size());
54-
}
55-
56-
@Test
57-
public void letsMockListSizeWithMultipleReturnValues() {
58-
when(list.size()).thenReturn(10).thenReturn(20);
59-
60-
//THEN
61-
assertEquals(10, list.size()); // First Call
62-
assertEquals(20, list.size()); // Second Call
63-
}
64-
65-
@Test
66-
public void letsMockListGet() {
67-
when(list.get(0)).thenReturn("in28Minutes");
68-
69-
//THEN
70-
assertEquals("in28Minutes", list.get(0));
71-
72-
assertNull(list.get(1)); //if un-stubbed value is called
73-
}
74-
75-
@Test(expected = RuntimeException.class)
76-
public void letsMockListGetToThrowException() {
77-
when(list.get(Mockito.anyInt())).thenThrow(new RuntimeException("Something went wrong"));
78-
list.get(0);
79-
}
80-
81-
@Test
82-
public void letsMockListGetWithAny() {
83-
//Argument Matcher
84-
when(list.get(Mockito.anyInt())).thenReturn("in28Minutes");
85-
86-
//THEN
87-
assertEquals("in28Minutes", list.get(0));
88-
assertEquals("in28Minutes", list.get(1));
89-
}
90-
91-
@Test(expected = InvalidUseOfMatchersException.class)
92-
public void letsMockListGetWithMixedStubValues() {
93-
when(list.subList(anyInt(), 5)).thenThrow(new RuntimeException("Something went wrong"));
94-
// If you are using argument matchers, all arguments have to be provided by matchers.
95-
96-
//THEN
97-
assertEquals("in28Minutes", list.get(0));
98-
assertEquals("in28Minutes", list.get(1));
99-
}
100-
101-
@Test
102-
public void letsMockListGetWithMixedStubValuesButHamcrestWorkaround() {
103-
when(list.subList(anyInt(), eq(5))).thenReturn(Collections.singletonList("Something"));
104-
105-
//THEN
106-
assertEquals("Something", list.subList(0, 5).get(0));
107-
//assertEquals(null, list.subList(0,5).get(1)); Index out of bounds
108-
}
109-
110-
@Test
111-
public void bddAliases_UsingGivenWillReturn() {
112-
//given
113-
BDDMockito.given(list.get(Mockito.anyInt())).willReturn("in28Minutes");
114-
115-
//THEN
116-
assertThat("in28Minutes", is(list.get(0)));
117-
assertThat("in28Minutes", is(list.get(1)));
118-
}
42+
@Rule
43+
public MockitoRule mockitoRule = MockitoJUnit.rule(); //Use this instead of RunWith(jUnitRunner)
44+
45+
@Mock
46+
private List<String> list;
47+
48+
@Test
49+
public void letsMockListSize() {
50+
when(list.size()).thenReturn(10);
51+
52+
//THEN
53+
assertEquals(10, list.size());
54+
}
55+
56+
@Test
57+
public void letsMockListSizeWithMultipleReturnValues() {
58+
when(list.size()).thenReturn(10).thenReturn(20);
59+
60+
//THEN
61+
assertEquals(10, list.size()); // First Call
62+
assertEquals(20, list.size()); // Second Call
63+
}
64+
65+
@Test
66+
public void letsMockListGet() {
67+
when(list.get(0)).thenReturn("in28Minutes");
68+
69+
//THEN
70+
assertEquals("in28Minutes", list.get(0));
71+
72+
assertNull(list.get(1)); //if un-stubbed value is called
73+
}
74+
75+
@Test(expected = RuntimeException.class)
76+
public void letsMockListGetToThrowException() {
77+
when(list.get(Mockito.anyInt())).thenThrow(new RuntimeException("Something went wrong"));
78+
list.get(0);
79+
}
80+
81+
@Test
82+
public void letsMockListGetWithAny() {
83+
//Argument Matcher
84+
when(list.get(Mockito.anyInt())).thenReturn("in28Minutes");
85+
86+
//THEN
87+
assertEquals("in28Minutes", list.get(0));
88+
assertEquals("in28Minutes", list.get(1));
89+
}
90+
91+
@Test(expected = InvalidUseOfMatchersException.class)
92+
public void letsMockListGetWithMixedStubValues() {
93+
when(list.subList(anyInt(), 5)).thenThrow(new RuntimeException("Something went wrong"));
94+
// If you are using argument matchers, all arguments have to be provided by matchers.
95+
96+
//THEN
97+
assertEquals("in28Minutes", list.get(0));
98+
assertEquals("in28Minutes", list.get(1));
99+
}
100+
101+
@Test
102+
public void letsMockListGetWithMixedStubValuesButHamcrestWorkaround() {
103+
when(list.subList(anyInt(), eq(5))).thenReturn(Collections.singletonList("Something"));
104+
105+
//THEN
106+
assertEquals("Something", list.subList(0, 5).get(0));
107+
//assertEquals(null, list.subList(0,5).get(1)); Index out of bounds
108+
}
109+
110+
@Test
111+
public void bddAliases_UsingGivenWillReturn() {
112+
//given
113+
BDDMockito.given(list.get(Mockito.anyInt())).willReturn("in28Minutes");
114+
115+
//THEN
116+
assertThat("in28Minutes", is(list.get(0)));
117+
assertThat("in28Minutes", is(list.get(1)));
118+
}
119119
}

Testing/Mockito/src/test/java/udemy/mociktoin28minutes/buisness/TodoBusinessImplMockitoTest.java

+56-56
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.junit.Test;
44
import org.junit.runner.RunWith;
55
import org.mockito.*;
6-
import org.mockito.runners.MockitoJUnitRunner;
6+
import org.mockito.junit.MockitoJUnitRunner;
77
import udemy.mociktoin28minutes.data.api.TodoService;
88

99
import java.util.Arrays;
@@ -18,76 +18,76 @@
1818
@RunWith(MockitoJUnitRunner.class) //Instead of this we can use @Rule
1919
public class TodoBusinessImplMockitoTest {
2020

21-
@Mock
22-
private TodoService todoService;
23-
//TodoService todoService = = mock(TodoService.class); //GIVEN STEP
21+
@Mock
22+
private TodoService todoService;
23+
//TodoService todoService = = mock(TodoService.class); //GIVEN STEP
2424

25-
@InjectMocks
26-
private TodoBusinessImpl todoBusinessImpl;
27-
//TodoBusinessImpl todoBusinessImpl = new TodoBusinessImpl(todoService); //WHEN STEP
25+
@InjectMocks
26+
private TodoBusinessImpl todoBusinessImpl;
27+
//TodoBusinessImpl todoBusinessImpl = new TodoBusinessImpl(todoService); //WHEN STEP
2828

29-
@Captor
30-
private ArgumentCaptor<String> stringArgumentCaptor;
31-
//ArgumentCaptor<String> argumentCaptor = ArgumentCaptor.forClass(String.class);
29+
@Captor
30+
private ArgumentCaptor<String> stringArgumentCaptor;
31+
//ArgumentCaptor<String> argumentCaptor = ArgumentCaptor.forClass(String.class);
3232

33-
private List<String> allTodoTasks = Arrays.asList("Learn Spring MVC", "Learn Spring", "Learn to Dance");
33+
private List<String> allTodoTasks = Arrays.asList("Learn Spring MVC", "Learn Spring", "Learn to Dance");
3434

35-
@Test
36-
public void usingMockito() {
37-
//GIVEN
38-
//1. Mock
39-
//2. todos arglist
35+
@Test
36+
public void usingMockito() {
37+
//GIVEN
38+
//1. Mock
39+
//2. todos arglist
4040

41-
//WHEN
42-
when(todoService.retrieveTodoTasks("Saurabh")).thenReturn(allTodoTasks);
43-
List<String> todos = todoBusinessImpl.retrieveTodoTasksRelatedToSpring("Saurabh");
41+
//WHEN
42+
when(todoService.retrieveTodoTasks("Saurabh")).thenReturn(allTodoTasks);
43+
List<String> todos = todoBusinessImpl.retrieveTodoTasksRelatedToSpring("Saurabh");
4444

45-
//THEN
46-
assertEquals(2, todos.size());
47-
}
45+
//THEN
46+
assertEquals(2, todos.size());
47+
}
4848

49-
@Test
50-
public void usingMockito_UsingBDD() {
51-
//GIVEN
52-
//1. Mock
53-
//2. todos arglist
54-
BDDMockito.given(todoService.retrieveTodoTasks("Saurabh")).willReturn(allTodoTasks);
49+
@Test
50+
public void usingMockito_UsingBDD() {
51+
//GIVEN
52+
//1. Mock
53+
//2. todos arglist
54+
BDDMockito.given(todoService.retrieveTodoTasks("Saurabh")).willReturn(allTodoTasks);
5555

56-
//when
57-
List<String> todoTask = todoBusinessImpl.retrieveTodoTasksRelatedToSpring("Saurabh");
56+
//when
57+
List<String> todoTask = todoBusinessImpl.retrieveTodoTasksRelatedToSpring("Saurabh");
5858

59-
//then
60-
assertThat(todoTask.size(), is(2));
61-
}
59+
//then
60+
assertThat(todoTask.size(), is(2));
61+
}
6262

63-
@Test
64-
public void letsTestDeleteNow() {
65-
//GIVEN
66-
//1. Mock
67-
//2. todos arglist
63+
@Test
64+
public void letsTestDeleteNow() {
65+
//GIVEN
66+
//1. Mock
67+
//2. todos arglist
6868

69-
//WHEN
70-
when(todoService.retrieveTodoTasks("Saurabh")).thenReturn(allTodoTasks);
71-
todoBusinessImpl.deleteTodoTasksNotRelatedToSpring("Saurabh");
69+
//WHEN
70+
when(todoService.retrieveTodoTasks("Saurabh")).thenReturn(allTodoTasks);
71+
todoBusinessImpl.deleteTodoTasksNotRelatedToSpring("Saurabh");
7272

73-
//THEN
74-
verify(todoService).deleteTodo("Learn to Dance");
73+
//THEN
74+
verify(todoService).deleteTodo("Learn to Dance");
7575

76-
verify(todoService, Mockito.never()).deleteTodo("Learn Spring MVC");
76+
verify(todoService, Mockito.never()).deleteTodo("Learn Spring MVC");
7777

78-
verify(todoService, Mockito.never()).deleteTodo("Learn Spring");
78+
verify(todoService, Mockito.never()).deleteTodo("Learn Spring");
7979

80-
verify(todoService, Mockito.times(1)).deleteTodo("Learn to Dance"); // atLeastOnce, atLeast
81-
}
80+
verify(todoService, Mockito.times(1)).deleteTodo("Learn to Dance"); // atLeastOnce, atLeast
81+
}
8282

83-
@Test
84-
public void captureArgument() {
85-
//WHEN
86-
when(todoService.retrieveTodoTasks("Saurabh")).thenReturn(allTodoTasks);
87-
todoBusinessImpl.deleteTodoTasksNotRelatedToSpring("Saurabh");
83+
@Test
84+
public void captureArgument() {
85+
//WHEN
86+
when(todoService.retrieveTodoTasks("Saurabh")).thenReturn(allTodoTasks);
87+
todoBusinessImpl.deleteTodoTasksNotRelatedToSpring("Saurabh");
8888

89-
//THEN
90-
verify(todoService).deleteTodo(stringArgumentCaptor.capture());
91-
assertEquals("Learn to Dance", stringArgumentCaptor.getValue());
92-
}
89+
//THEN
90+
verify(todoService).deleteTodo(stringArgumentCaptor.capture());
91+
assertEquals("Learn to Dance", stringArgumentCaptor.getValue());
92+
}
9393
}

Testing/MutationPITesting/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<plugin>
3535
<groupId>org.pitest</groupId>
3636
<artifactId>pitest-maven</artifactId>
37-
<version>1.7.0</version>
37+
<version>1.7.2</version>
3838
<!-- <configuration>-->
3939
<!-- <targetClasses>-->
4040
<!-- <param>com.saurabh.*</param>-->

Testing/PluralSight/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
<dependency>
2828
<groupId>org.springframework</groupId>
2929
<artifactId>spring-beans</artifactId>
30-
<version>5.3.10</version>
30+
<version>5.3.12</version>
3131
</dependency>
3232
<dependency>
3333
<groupId>org.springframework</groupId>
3434
<artifactId>spring-context</artifactId>
35-
<version>5.3.10</version>
35+
<version>5.3.12</version>
3636
</dependency>
3737
</dependencies>
3838

0 commit comments

Comments
 (0)