Perform STEP path fix

This commit is contained in:
Fabio Sinibaldi 2022-09-14 11:27:45 +02:00
parent ae335a5289
commit 332807f8bb
2 changed files with 22 additions and 2 deletions

View File

@ -166,7 +166,8 @@ public class DefaultDocumentsClient<T extends Project> implements Projects<T> {
log.debug("Executing step on {} (class {}, useCaseDescriptor {}) with request {} ",
id, getManagedClass(),profileID, request);
Call<WebTarget, T> call = endpoint -> {
return ResponseCommons.check(endpoint.path(profileID).path(id).request(MediaType.APPLICATION_JSON).
return ResponseCommons.check(endpoint.path(profileID).path(InterfaceConstants.Methods.STEP)
.path(id).request(MediaType.APPLICATION_JSON).
post(Entity.entity(request, MediaType.APPLICATION_JSON)),getManagedClass());
};
T toReturn = delegate.make(call);

View File

@ -1,18 +1,28 @@
package org.gcube.application.geoportal.clients;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.Data;
import org.bson.Document;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.common.model.document.Project;
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
import org.junit.Test;
public class ProfiledConcessioniTest {
import java.rmi.RemoteException;
public class ProfiledConcessioniTest extends ProfiledDocumentsTest{
@Data
private static class MyClass {
private String field;
}
@Override
protected String getUCID() {
return "profiledConcessioni";
}
public void test(){
@ -25,4 +35,13 @@ public class ProfiledConcessioniTest {
System.out.println(Serialization.convert(doc, MyClass.class));
}
@Test
public void performSubmit() throws RemoteException, JsonProcessingException {
String id="630f912755e2947b0278c1be";
Project p = getClient().performStep(id,new StepExecutionRequest("SUBMIT-FOR-REVIEW",new Document()));
System.out.println("Result is "+Serialization.write(p));
}
}