Skip to content

Commit

Permalink
fix unit tests in backend
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpochat committed Jun 27, 2024
1 parent a6e2a4f commit 742b37d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import eu.viandeendirect.model.*;
import eu.viandeendirect.domains.production.PackageLotRepository;
import eu.viandeendirect.security.AuthenticationService;
import eu.viandeendirect.security.specs.AuthenticationServiceSpecs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -46,7 +47,7 @@ public class OrderService implements OrdersApiDelegate {
private StripePaymentRepository stripePaymentRepository;

@Autowired
private AuthenticationService authenticationService;
private AuthenticationServiceSpecs authenticationService;

@Override
public ResponseEntity<Order> getOrder(Integer orderId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import eu.viandeendirect.model.Customer;
import eu.viandeendirect.model.Producer;
import eu.viandeendirect.model.User;
import eu.viandeendirect.security.specs.AuthenticationServiceSpecs;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
Expand All @@ -20,7 +21,14 @@ public Producer getAuthenticatedProducer() {
@Override
public Customer getAuthenticatedCustomer() {
var customer = new Customer();
customer.setId(1000);
customer.setId(4000);
User user = new User();
user.setId(4000);
user.setFirstName("Freddy");
user.setLastName("MERCURY");
user.setPhone("0305060708");
user.setEmail("[email protected]");
customer.setUser(user);
return customer;
}
}

0 comments on commit 742b37d

Please sign in to comment.