updated branch

This commit is contained in:
Roni Dover 2024-06-12 16:03:44 -07:00
parent 3d1a428a38
commit 34b03c48f4
6 changed files with 37 additions and 27 deletions

View file

@ -7,7 +7,7 @@ public class PasswordUtils {
@WithSpan
public boolean vldtPswd(String usr, String pswd) {
try {
Thread.sleep(1);
Thread.sleep(2);
}
catch (InterruptedException e) {
throw new RuntimeException(e);

View file

@ -208,6 +208,7 @@ class OwnerController {
ModelAndView mav = new ModelAndView("owners/ownerDetails");
Owner owner = this.owners.findById(ownerId);
mav.addObject(owner);
return mav;
}

View file

@ -111,20 +111,6 @@ class PetController implements InitializingBean {
}
this.owners.save(owner);
// var pets = owner.getPets().toArray(Pet[]::new);
// var petRequests = owner.getPets()
// .stream()
// .map(x -> new
// PetVaccinationStatusService.UpdateVaccineStatusRequest(owner.getId(),
// x.getId()))
// .toList().subList(0,1);
// executorService.submit(() ->
// petVaccinationStatus.updateVaccinationStatus(petRequests)).get();
// executorService.submit(() ->
// petVaccinationStatus.updateVaccinationStatus(petRequests));
// petVaccinationStatus.updateVaccinationStatus(petRequests.subList(0,1));
//
vaccinationRequestMessage.Send();
return "redirect:/owners/{ownerId}";

View file

@ -22,7 +22,6 @@ spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
spring.kafka.bootstrap-servers=localhost:9092
spring.kafka.consumer.group-id=myGroup
# Logging
@ -33,3 +32,6 @@ logging.level.org.springframework=INFO
# Maximum time static resources should be cached
spring.web.resources.cache.cachecontrol.max-age=12h
server.port=8082
#spring.datasource.hikari.maximum-pool-size=1

View file

@ -10,6 +10,7 @@ import org.hamcrest.Matchers;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.runners.Parameterized;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.server.LocalServerPort;
@ -92,17 +93,37 @@ class OwnerControllerTests {
@Test
void shouldProvideOwnerVaccinationDate() {
Owner owner = CreateOwner();
for (int i=0; i<10;i++){
Owner owner = CreateOwner();
var ownerLinkMatcher = String.format("**.findAll { node -> node.@href=='/owners/%s'}", owner.getId());
var ownerLinkMatcher = String.format("**.findAll { node -> node.@href=='/owners/%s'}", owner.getId());
given().contentType(ContentType.JSON)
.when()
.get("/owners")
.then()
.contentType(ContentType.HTML)
.statusCode(200)
.body(ownerLinkMatcher, Matchers.notNullValue());
}
for (int i=0; i<50;i++) {
given().contentType(ContentType.JSON)
.when()
.get("/owners")
.then()
.contentType(ContentType.HTML)
.statusCode(200);
try {
Thread.sleep(200);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
given().contentType(ContentType.JSON)
.when()
.get("/owners")
.then()
.contentType(ContentType.HTML)
.statusCode(200)
.body(ownerLinkMatcher, Matchers.notNullValue());
// assertThat(false).isTrue();

View file

@ -9,12 +9,12 @@
<collectionProp name="Arguments.arguments">
<elementProp name="PETCLINIC_HOST" elementType="Argument">
<stringProp name="Argument.name">PETCLINIC_HOST</stringProp>
<stringProp name="Argument.value">a25c892af46df47589102bdef28fda12-1374796034.eu-west-1.elb.amazonaws.com</stringProp>
<stringProp name="Argument.value">ec2-18-201-81-102.eu-west-1.compute.amazonaws.com</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="PETCLINIC_PORT" elementType="Argument">
<stringProp name="Argument.name">PETCLINIC_PORT</stringProp>
<stringProp name="Argument.value">80</stringProp>
<stringProp name="Argument.value">8082</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="CONTEXT_WEB" elementType="Argument">