Skip to content

Commit

Permalink
Cleaned unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Feb 3, 2025
1 parent 0ca09df commit b05610e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class InstitutionControllerTest {
private InstitutionService institutionServiceMock;


/*@Test
@Test
void search() throws Exception {
// given
final String search = "search";
Expand All @@ -55,7 +55,7 @@ void search() throws Exception {
.thenReturn(new DummyInstitutionQueryResult());
// when
mvc.perform(MockMvcRequestBuilders
.get(BASE_URL + "/")
.get(BASE_URL)
.queryParam("search", search)
.queryParam("page", page)
.queryParam("limit", limit)
Expand All @@ -81,9 +81,9 @@ void search() throws Exception {
verify(institutionServiceMock, times(1))
.search(Optional.of(search), Integer.parseInt(page), Integer.parseInt(limit));
verifyNoMoreInteractions(institutionServiceMock);
}*/
}

/*@Test
@Test
void searchFiltered() throws Exception {
// given
final String search = "search";
Expand All @@ -94,7 +94,7 @@ void searchFiltered() throws Exception {
.thenReturn(new DummyInstitutionQueryResult());
// when
mvc.perform(MockMvcRequestBuilders
.get(BASE_URL + "/")
.get(BASE_URL)
.queryParam("search", search)
.queryParam("page", page)
.queryParam("limit", limit)
Expand All @@ -121,17 +121,17 @@ void searchFiltered() throws Exception {
verify(institutionServiceMock, times(1))
.search(Optional.of(search), categories, Integer.parseInt(page), Integer.parseInt(limit));
verifyNoMoreInteractions(institutionServiceMock);
}*/
}


/*@Test
@Test
void search_defaultInputParams() throws Exception {
// given
when(institutionServiceMock.search(any(), anyInt(), anyInt()))
.thenReturn(new DummyInstitutionQueryResult());
// when
mvc.perform(MockMvcRequestBuilders
.get(BASE_URL + "/")
.get(BASE_URL)
.contentType(APPLICATION_JSON_VALUE)
.accept(APPLICATION_JSON_VALUE))
.andExpect(status().isOk())
Expand All @@ -154,7 +154,7 @@ void search_defaultInputParams() throws Exception {
verify(institutionServiceMock, times(1))
.search(Optional.empty(), 1, 10);
verifyNoMoreInteractions(institutionServiceMock);
}*/
}


@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void findInsuranceNyOriginIdNotFound() throws Exception {
/**
* Method under test: {@link IvassController#search(Optional, Integer, Integer)}
*/
/*@Test
@Test
void search() throws Exception {
// given
final String search = "search";
Expand All @@ -104,7 +104,7 @@ void search() throws Exception {
.thenReturn(new DummyInsuranceQueryResult());
// when
mvc.perform(MockMvcRequestBuilders
.get(BASE_URL + "/")
.get(BASE_URL)
.queryParam("search", search)
.queryParam("page", page)
.queryParam("limit", limit)
Expand All @@ -125,19 +125,19 @@ void search() throws Exception {
verify(ivassService, times(1))
.search(Optional.of(search), Integer.parseInt(page), Integer.parseInt(limit));
verifyNoMoreInteractions(ivassService);
}*/
}

/**
* Method under test: {@link IvassController#search(Optional, Integer, Integer)}
*/
/*@Test
@Test
void search_defaultInputParams() throws Exception {
// given
when(ivassService.search(any(), anyInt(), anyInt()))
.thenReturn(new DummyInsuranceQueryResult());
// when
mvc.perform(MockMvcRequestBuilders
.get(BASE_URL + "/")
.get(BASE_URL)
.contentType(APPLICATION_JSON_VALUE)
.accept(APPLICATION_JSON_VALUE))
.andExpect(status().isOk())
Expand All @@ -154,5 +154,5 @@ void search_defaultInputParams() throws Exception {
verify(ivassService, times(1))
.search(Optional.empty(), 1, 10);
verifyNoMoreInteractions(ivassService);
}*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class StationControllerTest {
@MockBean
private StationService stationServiceMock;

/*@Test
@Test
void search() throws Exception {
// given
final String search = "search";
Expand All @@ -53,7 +53,7 @@ void search() throws Exception {
.thenReturn(new DummyPDNDQueryResult());
// when
mvc.perform(MockMvcRequestBuilders
.get(BASE_URL + "/")
.get(BASE_URL)
.queryParam("search", search)
.queryParam("page", page)
.queryParam("limit", limit)
Expand All @@ -73,16 +73,16 @@ void search() throws Exception {
verify(stationServiceMock, times(1))
.search(Optional.of(search), Integer.parseInt(page), Integer.parseInt(limit));
verifyNoMoreInteractions(stationServiceMock);
}*/
}

/*@Test
@Test
void search_defaultInputParams() throws Exception {
// given
when(stationServiceMock.search(any(), anyInt(), anyInt()))
.thenReturn(new DummyPDNDQueryResult());
// when
mvc.perform(MockMvcRequestBuilders
.get(BASE_URL + "/")
.get(BASE_URL)
.contentType(APPLICATION_JSON_VALUE)
.accept(APPLICATION_JSON_VALUE))
.andExpect(status().isOk())
Expand All @@ -99,7 +99,7 @@ void search_defaultInputParams() throws Exception {
verify(stationServiceMock, times(1))
.search(Optional.empty(), 1, 10);
verifyNoMoreInteractions(stationServiceMock);
}*/
}

@Test
void findStation() throws Exception {
Expand Down

0 comments on commit b05610e

Please sign in to comment.