spring-cloud-contract 프레임 워크를 사용하여 계약서를 작성하는 동안 주어진 텍스트와 일치하는 응답의 특정 필드 만 테스트하는 방법이 있습니까?봄 구름 콘택트 생성에서 응답에 partcular를 체크합니다.
package contracts
import org.springframework.cloud.contract.spec.Contract
Contract.make {
request {
method 'GET'
url value(consumer(regex('/app/emp/employee/[0-9]{3}')), producer('/app/emp/employee/151'))
}
response {
status 200
body([
subjectsList: null,
errorResponse: null,
status: 'success',
employeeList: null,
Employee: [
EmployeeId: 151,
firstName: 'xxx',
lastName: 'xxx',
middleName: 'xxx',
dateOfBirth: 01012001,
status: 'inbound',
cin: '345',
ssn: null,
EmployeeType: 'HoH',
preferredLanguage: 'french',
preferredContactMethod: null,
createdBy: null,
creadtedOn: null,
updatedBy: null,
updatedOn: null,
transactionId: null
],
paginated: null
])
headers {
header('Content-Type': value(
producer(regex('application/json.*')),
Employee('application/json')
))
}
}
}
대신 완전 반응을 쓰기 만 특정 검사 예에 대한 응답에 존재하는 속성 수있는 방법이 있나요 : 언어 = 사전에
감사합니다 '프랑스', 당신의 도움이 대단히 감사드립니다.