Skip to content

Commit

Permalink
Changes to no longer require initial user
Browse files Browse the repository at this point in the history
  • Loading branch information
arcshiftsolutions committed Jun 5, 2024
1 parent 2d5f42f commit 48565f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public class EdxSagaController implements EdxSagaEndpoint {
@Getter(AccessLevel.PRIVATE)
private final SecureExchangeCommentSagaValidator secureExchangeCommentSagaValidator;

@Getter(AccessLevel.PRIVATE)
private final CreateSchoolSagaPayloadValidator createSchoolSagaPayloadValidator;

@Getter(AccessLevel.PRIVATE)
private final EdxFileOnboardingService edxFileOnboardingService;

Expand All @@ -64,14 +61,13 @@ public class EdxSagaController implements EdxSagaEndpoint {

private static final SagaDataMapper SAGA_DATA_MAPPER = SagaDataMapper.mapper;

public EdxSagaController(EdxActivationCodeSagaDataPayloadValidator edxActivationCodeSagaDataPayLoadValidator, SagaService sagaService, List<Orchestrator> orchestrators, SecureExchangePayloadValidator secureExchangePayloadValidator, SecureExchangeCommentSagaValidator secureExchangeCommentSagaValidator, CreateSecureExchangeSagaPayloadValidator createSecureExchangeSagaPayloadValidator, EdxUserPayloadValidator edxUserPayLoadValidator, CreateSchoolSagaPayloadValidator createSchoolSagaPayloadValidator, EdxFileOnboardingService edxFileOnboardingService) {
public EdxSagaController(EdxActivationCodeSagaDataPayloadValidator edxActivationCodeSagaDataPayLoadValidator, SagaService sagaService, List<Orchestrator> orchestrators, SecureExchangePayloadValidator secureExchangePayloadValidator, SecureExchangeCommentSagaValidator secureExchangeCommentSagaValidator, CreateSecureExchangeSagaPayloadValidator createSecureExchangeSagaPayloadValidator, EdxUserPayloadValidator edxUserPayLoadValidator, EdxFileOnboardingService edxFileOnboardingService) {
this.edxActivationCodeSagaDataPayLoadValidator = edxActivationCodeSagaDataPayLoadValidator;
this.sagaService = sagaService;
this.secureExchangePayloadValidator = secureExchangePayloadValidator;
this.secureExchangeCommentSagaValidator = secureExchangeCommentSagaValidator;
this.createSecureExchangeSagaPayloadValidator = createSecureExchangeSagaPayloadValidator;
this.edxUserPayLoadValidator = edxUserPayLoadValidator;
this.createSchoolSagaPayloadValidator = createSchoolSagaPayloadValidator;
this.edxFileOnboardingService = edxFileOnboardingService;
orchestrators.forEach(orchestrator -> this.orchestratorMap.put(orchestrator.getSagaName(), orchestrator));
log.info("'{}' Saga Orchestrators are loaded.", String.join(",", this.orchestratorMap.keySet()));
Expand Down Expand Up @@ -126,7 +122,6 @@ public ResponseEntity<String> createSchool(CreateSchoolSagaData sagaData) {
if (edxUser != null) {
validatePayload(() -> getEdxUserPayLoadValidator().validateEdxUserPayload(edxUser, true));
}
validatePayload(() -> getCreateSchoolSagaPayloadValidator().validateCreateSchoolSagaPayload(sagaData));
return this.processNewSchoolSaga(CREATE_NEW_SCHOOL_SAGA, sagaData);
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ void testCreateSchool_GivenInvalidEdxUser_ShouldReturnBadRequest() throws Except
}

@Test
void testCreateSchool_GivenNoInitialUserAndIndependentOffshoreCategory_ShouldReturnBadRequest() throws Exception {
void testCreateSchool_GivenNoInitialUserAndIndependentOffshoreCategory_ShouldReturnOk() throws Exception {
School school = createDummySchool();
school.setSchoolCategoryCode("INDEPEND");

Expand All @@ -883,7 +883,7 @@ void testCreateSchool_GivenNoInitialUserAndIndependentOffshoreCategory_ShouldRet
.content(getJsonString(sagaData))
.accept(MediaType.APPLICATION_JSON)
.with(jwt().jwt((jwt) -> jwt.claim("scope", "CREATE_SCHOOL_SAGA"))))
.andDo(print()).andExpect(status().isBadRequest());
.andDo(print()).andExpect(status().isAccepted());
}

@Test
Expand Down

0 comments on commit 48565f6

Please sign in to comment.