Skip to content

Commit

Permalink
Vaunt version increased and model imported
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe444 committed Jun 6, 2019
1 parent cceccac commit 98f3518
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 138 deletions.
10 changes: 10 additions & 0 deletions judge-d-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,16 @@
<version>1.2.4.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.hltech</groupId>
<artifactId>vaunt-validator</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>com.hltech</groupId>
<artifactId>vaunt-core</artifactId>
<version>1.0.6</version>
</dependency>
</dependencies>

<build>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.guava.GuavaModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.hltech.vaunt.core.domain.model.Contract;
import com.hltech.vaunt.validator.ValidationError;
import com.hltech.vaunt.validator.ValidationResult;
import com.hltech.vaunt.validator.VauntValidator;
import dev.hltech.dredd.domain.validation.InterfaceContractValidator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
Expand All @@ -22,6 +28,8 @@ public class JmsContractValidator extends InterfaceContractValidator<List<Contra
public JmsContractValidator() {
super(COMMUNICATION_INTERFACE);
objectMapper = new ObjectMapper();
objectMapper.registerModule(new GuavaModule());
objectMapper.registerModule(new JavaTimeModule());
}

@Override
Expand All @@ -48,9 +56,7 @@ public List<Contract> asExpectations(String rawExpectations) {

@Override
public List<InteractionValidationResult> validate(List<Contract> expectations, List<Contract> capabilities) {
VauntValidator vauntValidator = new VauntValidator();

List<ValidationResult> validationResults = vauntValidator.validate(expectations, capabilities);
List<ValidationResult> validationResults = new VauntValidator().validate(expectations, capabilities);

return validationResults.stream()
.map(this::toInteractionValidationResult)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package dev.hltech.dredd.domain.validation.jms
import com.fasterxml.jackson.module.jsonSchema.types.NullSchema
import com.fasterxml.jackson.module.jsonSchema.types.NumberSchema
import com.fasterxml.jackson.module.jsonSchema.types.StringSchema
import com.hltech.vaunt.core.domain.model.Contract
import com.hltech.vaunt.core.domain.model.DestinationType
import dev.hltech.dredd.domain.validation.InterfaceContractValidator
import spock.lang.Specification
import spock.lang.Subject
Expand Down Expand Up @@ -105,7 +107,7 @@ class JmsContractValidatorUT extends Specification {
}
}

def "If there are some umnatched expectatuions - validation results with success"() {
def "If there are some unmatched expectations - validation results with success"() {
given:
def expectations = [new Contract(DestinationType.QUEUE, 'dst', new StringSchema()),
new Contract(DestinationType.TOPIC, 'dst', new StringSchema()),
Expand Down

0 comments on commit 98f3518

Please sign in to comment.