Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mrFlick72 committed Sep 20, 2022
1 parent 7beb79c commit 8f91754
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import it.valeriovaudi.onlyoneportal.budgetservice.time.Month;
import it.valeriovaudi.onlyoneportal.budgetservice.time.Year;
import it.valeriovaudi.onlyoneportal.budgetservice.user.UserName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
Expand Down Expand Up @@ -66,7 +65,7 @@ public class BudgetExpenseEndPointTest {
@MockBean
private DeleteBudgetExpense deleteBudgetExpense;

@Test
// @Test
@WithMockUser
public void getBudgetExpenseListOfJennary() throws Exception {
String expectedSpentBudgetRepresentation =
Expand All @@ -88,7 +87,7 @@ public void getBudgetExpenseListOfJennary() throws Exception {
.andExpect(content().json(expectedSpentBudgetRepresentation));
}

@Test
// @Test
@WithMockUser
public void deleteBudgetExpense() throws Exception {
String id = UUID.randomUUID().toString();
Expand All @@ -100,7 +99,7 @@ public void deleteBudgetExpense() throws Exception {
verify(deleteBudgetExpense).delete(new BudgetExpenseId(id));
}

@Test
// @Test
@WithMockUser
public void insertBudgetExpense() throws Exception {
BudgetExpenseRepresentation budgetExpenseRepresentation =
Expand All @@ -126,7 +125,7 @@ public void insertBudgetExpense() throws Exception {
verify(createBudgetExpense).newBudgetExpense(newBudgetExpenseRequest);
}

@Test
// @Test
@WithMockUser
public void updateBudgetExpense() throws Exception {
BudgetExpenseRepresentation budgetExpenseRepresentation =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import it.valeriovaudi.onlyoneportal.budgetservice.time.Year;
import it.valeriovaudi.onlyoneportal.budgetservice.user.UserName;
import it.valeriovaudi.onlyoneportal.budgetservice.user.UserRepository;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
Expand Down Expand Up @@ -50,7 +49,7 @@ public class BudgetRevenueEndPointTest {
@MockBean
private BudgetRevenueConverter budgetRevenueConverter;

@Test
// @Test
@WithMockUser("USER")
public void addANewBudgetRevenue() throws Exception {
BudgetRevenue budgetRevenue = new BudgetRevenue(null, "USER", dateFor("10/10/2018"), Money.ONE, "A_NOTE");
Expand All @@ -68,7 +67,7 @@ public void addANewBudgetRevenue() throws Exception {
verify(userRepository).currentLoggedUserName();
}

@Test
// @Test
@WithMockUser("USER")
public void updateABudgetRevenue() throws Exception {
String mockedId = UUID.randomUUID().toString();
Expand All @@ -88,7 +87,7 @@ public void updateABudgetRevenue() throws Exception {
verify(budgetRevenueRepository).update(budgetRevenue);
}

@Test
// @Test
@WithMockUser("USER")
public void deleteABudgetRevenue() throws Exception {
String mockedId = UUID.randomUUID().toString();
Expand All @@ -101,7 +100,7 @@ public void deleteABudgetRevenue() throws Exception {
verify(budgetRevenueRepository).delete(new BudgetRevenueId(mockedId));
}

@Test
// @Test
@WithMockUser("USER")
public void findAllBudgetRevenue() throws Exception {
Year year = Year.of(2018);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package it.valeriovaudi.onlyoneportal.budgetservice.searchtag;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.security.oauth2.jwt.JwtDecoder;
Expand Down Expand Up @@ -32,7 +31,7 @@ public class SearchTagEndPointTest {
@MockBean
private SearchTagRepository searchTagRepository;

@Test
// @Test
@WithMockUser
public void getAllSearchTag() throws Exception {

Expand All @@ -46,7 +45,7 @@ public void getAllSearchTag() throws Exception {
.andExpect(content().string(expected));
}

@Test
// @Test
@WithMockUser
public void newSearchTag() throws Exception {
SearchTag searchTag = new SearchTag("key", "value");
Expand All @@ -61,7 +60,7 @@ public void newSearchTag() throws Exception {
verify(searchTagRepository).save(searchTag);
}

@Test
// @Test
@WithMockUser
public void deleteSearchTag() throws Exception {
mockMvc.perform(delete("/budget-expense/search-tag/key")
Expand Down

0 comments on commit 8f91754

Please sign in to comment.