Skip to content

Commit

Permalink
Adjust tests to changes
Browse files Browse the repository at this point in the history
  • Loading branch information
FloBoJa committed Mar 23, 2024
1 parent ff30681 commit e859e28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void testRepository() {
this.assertComponentProvidesOperation("org_springframework_samples_petclinic_customers_web_PetResource",
"customers-service/petTypes[GET]", "customers-service/petTypes[GET]");

this.assertMaxParameterCount(2, "customers-service/owners[PUT]", "customers-service/owners[PUT]");
this.assertMaxParameterCount(2, "customers-service/owners[GET,POST,PUT]", "customers-service/owners[PUT]");
this.assertMaxParameterCount(1, "api-gateway/api/gateway/owners[GET]", "api-gateway/api/gateway/owners[GET]");

this.assertComponentRequiresComponent("org_springframework_samples_petclinic_customers_web_PetResource",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import org.palladiosimulator.retriever.extraction.commonalities.JavaOperationName;
import org.palladiosimulator.retriever.extraction.commonalities.Operation;
import org.palladiosimulator.retriever.extraction.commonalities.OperationInterface;
import org.palladiosimulator.retriever.extraction.commonalities.RESTName;
import org.palladiosimulator.retriever.extraction.commonalities.RESTOperationName;
import org.palladiosimulator.retriever.extraction.commonalities.RESTOperationUnion;

public class InterfaceTest {

Expand Down Expand Up @@ -172,7 +172,8 @@ void entirePathInterface() {
final List<OperationInterface> visibleProvisions = List.of(firstMethod, secondMethod);

final Component builtComponent = builder.create(allDependencies, visibleProvisions);
final EntireInterface expectedInterface = new EntireInterface(new RESTName("test-host", "/common_interface"));
final OperationInterface expectedInterface = new RESTOperationUnion(
new RESTOperationName("test-host", "/common_interface"));
assertTrue(builtComponent.provisions()
.containsPartOf(expectedInterface));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.palladiosimulator.retriever.extraction.commonalities.Operation;
import org.palladiosimulator.retriever.extraction.commonalities.RESTName;
import org.palladiosimulator.retriever.extraction.commonalities.RESTOperationName;
import org.palladiosimulator.retriever.extraction.commonalities.RESTOperationUnion;

public class PathTest {

Expand Down Expand Up @@ -43,13 +44,13 @@ void prefixesAreSeparatorAware() {
}

@Test
void httpMethodsAreSpecializations() {
void httpMethodsMatchCorrectly() {
final String path = "/some/path";
final RESTOperationName generalName = new RESTOperationName("test-host", path);
final RESTOperationName generalName = new RESTOperationName("test-host", path, HTTPMethod.WILDCARD);
final RESTOperationName specificName = new RESTOperationName("test-host", path, HTTPMethod.GET);

final Operation generalOperation = new Operation(null, generalName);
final Operation specificOperation = new Operation(null, specificName);
final RESTOperationUnion generalOperation = new RESTOperationUnion(generalName);
final RESTOperationUnion specificOperation = new RESTOperationUnion(specificName);

assertTrue(specificOperation.isPartOf(generalOperation));
assertFalse(generalOperation.isPartOf(specificOperation));
Expand Down

0 comments on commit e859e28

Please sign in to comment.