Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add capability of assessing the impact of set of services on given env #95

Merged
merged 2 commits into from
Dec 5, 2019

Conversation

krzyzy
Copy link
Member

@krzyzy krzyzy commented Dec 1, 2019

No description provided.

@krzyzy krzyzy requested a review from Felipe444 December 2, 2019 21:50
@@ -36,9 +46,40 @@ public JudgeD(EnvironmentRepository environmentRepository, ServiceContractsRepos
return getValidatorResult(validatedService, environmentContracts, validator);
}

public <C, E> Map<ServiceVersion, EnvironmentValidatorResult> validatedServicesAgainstEnvironment(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better method name

.collect(toList());

// replace environment contracts with validated ones
validatedContracts.forEach(validatedContract -> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be validated

@@ -36,9 +46,40 @@ public JudgeD(EnvironmentRepository environmentRepository, ServiceContractsRepos
return getValidatorResult(validatedService, environmentContracts, validator);
}

public <C, E> Map<ServiceVersion, EnvironmentValidatorResult> validatedServicesAgainstEnvironment(
List<ServiceContracts> validatedContracts,
String env,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we forfeit possiblity of testing external environments. I think that batch should allow to include external environment (i.e. multiple environments) like in another endpoint (above)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will do it in another iteration.

@@ -25,7 +31,11 @@ public JudgeD(EnvironmentRepository environmentRepository, ServiceContractsRepos
this.serviceContractsRepository = serviceContractsRepository;
}

public <C, E> EnvironmentValidatorResult validateServiceAgainstEnvironments(ServiceContracts validatedService, List<String> environments, InterfaceContractValidator<C, E> validator) {
public <C, E> EnvironmentValidatorResult validateServiceAgainstEnvironments(
ServiceContracts validatedService,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be validated

import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(value = HttpStatus.BAD_REQUEST)
public class RequestValidationException extends RuntimeException {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use it in another endpoints to remain consistent

import org.springframework.http.MediaType
import spock.lang.Specification

import static dev.hltech.dredd.domain.contracts.ServiceContracts.*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wildcard...

@Felipe444
Copy link
Collaborator

Please add all last changes to readme so that it is clear what we can do in Judged

@krzyzy krzyzy merged commit f49baac into master Dec 5, 2019
@coveralls
Copy link

Pull Request Test Coverage Report for Build 368

  • 52 of 53 (98.11%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 96.435%

Changes Missing Coverage Covered Lines Changed/Added Lines %
judge-d-server/src/main/java/dev/hltech/dredd/interfaces/rest/validation/BatchValidationReportDto.java 3 4 75.0%
Totals Coverage Status
Change from base Build 364: 0.1%
Covered Lines: 568
Relevant Lines: 589

💛 - Coveralls

@wlodarcp wlodarcp deleted the feature/validate_multiple_services branch August 25, 2021 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants