Skip to content

Commit

Permalink
[MODAUD-174] - Increased code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
azizbekxm committed Nov 10, 2023
1 parent 97e24a2 commit 0d3017b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class PieceEventConsumersVerticle extends AbstractConsumersVerticle {

@Override
public List<String> getEvents() {
return List.of(AcquisitionEventType.ACQ_ORDER_CHANGED.getTopicName());
return List.of(AcquisitionEventType.ACQ_PIECE_CHANGED.getTopicName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;


import java.util.Date;
import java.util.UUID;

Expand All @@ -28,39 +27,31 @@

public class AuditDataAcquisitionAPITest extends ApiTestBase {

public static final Header TENANT = new Header("X-Okapi-Tenant", "modaudittest");

protected static final Header PERMS = new Header("X-Okapi-Permissions", "audit.all");

protected static final Header CONTENT_TYPE = new Header("Content-Type", "application/json");

protected static final String INVALID_ID = "646ea52c-2c65-4d28-9a8f-e0d200fd6b00";

protected static final String ACQ_AUDIT_ORDER_PATH = "/audit-data/acquisition/order/";

protected static final String ACQ_AUDIT_ORDER_LINE_PATH = "/audit-data/acquisition/order-line/";

protected static final String ACQ_AUDIT_PIECE_PATH = "/audit-data/acquisition/piece/";

private static final Header TENANT = new Header("X-Okapi-Tenant", "modaudittest");
private static final Header PERMS = new Header("X-Okapi-Permissions", "audit.all");
private static final Header CONTENT_TYPE = new Header("Content-Type", "application/json");
private static final String INVALID_ID = "646ea52c-2c65-4d28-9a8f-e0d200fd6b00";
private static final String ACQ_AUDIT_ORDER_PATH = "/audit-data/acquisition/order/";
private static final String ACQ_AUDIT_ORDER_LINE_PATH = "/audit-data/acquisition/order-line/";
private static final String ACQ_AUDIT_PIECE_PATH = "/audit-data/acquisition/piece/";
private static final String TENANT_ID = "modaudittest";

@Spy
private PostgresClientFactory postgresClientFactory = new PostgresClientFactory(Vertx.vertx());

@InjectMocks
OrderEventsDaoImpl orderEventDao = new OrderEventsDaoImpl(postgresClientFactory);
OrderEventsDaoImpl orderEventDao;

@InjectMocks
OrderLineEventsDaoImpl orderLineEventDao = new OrderLineEventsDaoImpl(postgresClientFactory);
OrderLineEventsDaoImpl orderLineEventDao;
@InjectMocks
PieceEventsDaoImpl pieceEventsDao = new PieceEventsDaoImpl(postgresClientFactory);
PieceEventsDaoImpl pieceEventsDao;

@BeforeEach
public void setUp() {
MockitoAnnotations.openMocks(this);
orderEventDao = new OrderEventsDaoImpl(postgresClientFactory);
orderLineEventDao = new OrderLineEventsDaoImpl(postgresClientFactory);

}

@Test
Expand Down Expand Up @@ -126,7 +117,7 @@ void shouldReturnOrderLineEventsOnGetByOrderLineId() {
}

@Test
void shouldReturnOrderLineEventsOnGetByPieceId() {
void shouldReturnPieceEventsOnGetByPieceId() {
var pieceAuditEvent = createPieceAuditEvent(UUID.randomUUID().toString());

pieceEventsDao.save(pieceAuditEvent, TENANT_ID);
Expand Down

0 comments on commit 0d3017b

Please sign in to comment.