Commit 70c21e50 authored by handolukats's avatar handolukats
Browse files

TEIS-1315 added controller test

parent 27d939fb
package ee.sm.ti.teis.commongateway.riskassessments.riskassessment;
import ee.sm.ti.teis.commongateway.CommonApiGatewayTestBase;
import ee.sm.ti.teis.commongateway.riskassessments.riskassessment.dto.CopyRiskAssessmentDto;
import ee.sm.ti.teis.commongateway.riskassessments.riskassessment.dto.CreateRiskAssessmentDto;
import ee.sm.ti.teis.commongateway.riskassessments.riskassessment.dto.RiskAssessmentPublicDto;
import ee.sm.ti.teis.commongateway.riskassessments.riskassessment.dto.UpdateRiskAssessmentStatusDto;
import ee.sm.ti.teis.commongateway.riskassessments.riskassessment.dto.UpdateRiskAssessmentTitleDto;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
......@@ -9,6 +11,8 @@ import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.UUID;
import static java.util.UUID.randomUUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
......@@ -35,6 +39,13 @@ class RiskAssessmentControllerTest extends CommonApiGatewayTestBase {
() -> controller.create(new CreateRiskAssessmentDto(), new RequestMetaDTO()));
}
@Test
void copy_badRequest() {
assertThrows(NoResponseFromRabbitException.class,
() -> controller.copy(randomUUID(), CopyRiskAssessmentDto.builder()
.riskAssessment(RiskAssessmentPublicDto.builder().id(UUID.randomUUID()).build()).build(), new RequestMetaDTO()));
}
@Test
void getBusinessTypes_badRequest() {
assertThrows(NoResponseFromRabbitException.class,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment