Skip to content

Commit

Permalink
Implement static dashboard url (#47 step 2)
Browse files Browse the repository at this point in the history
Fix getinstance support in ProcessorChainServiceInstanceService
  • Loading branch information
gberche-orange committed May 25, 2020
1 parent 996caf1 commit 3fc37fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion TODO-coabc.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Implement static dashboard url (#47 step 2)
- DefaultBrokerProcessor.preGetServiceInstance() +
- BoshProcessor.preGetServiceInstance() + BoshProcessorTest :
- Return dashboard previously recorded in `coab-vars.yml`
- Extract existing code login into Repository
- Extract existing code into Repository/interface
- read coab-depls/c_0a9018b8-7cb2-47c1-9542-0aceb8ca740a/template/coab-vars.yml into CoabVarsDto
- BoshBrokerApplication.paasTemplateContextFilter:
- check whether other steps could skip paas-secrets clone

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class ProcessorChainServiceInstanceService implements ServiceInstanceServ


public static final String GET_SERVICE_INSTANCE_REQUEST = "GetServiceInstanceRequest";
public static final String GET_SERVICE_INSTANCE_RESPONSE = "GetServiceInstanceResponse";
public static final String CREATE_SERVICE_INSTANCE_REQUEST = "CreateServiceInstanceRequest";
public static final String CREATE_SERVICE_INSTANCE_RESPONSE = "CreateServiceInstanceResponse";
public static final String GET_LAST_SERVICE_OPERATION_REQUEST = "GetLastServiceOperationRequest";
Expand Down Expand Up @@ -68,11 +69,11 @@ public GetServiceInstanceResponse getServiceInstance(GetServiceInstanceRequest r
try {
Context ctx=new Context();
ctx.contextKeys.put(GET_SERVICE_INSTANCE_REQUEST, request);
processorChain.create(ctx);
processorChain.getInstance(ctx);

GetServiceInstanceResponse response;
if (ctx.contextKeys.get(GET_SERVICE_INSTANCE_REQUEST) instanceof GetServiceInstanceRequest) {
response = (GetServiceInstanceResponse) ctx.contextKeys.get(GET_SERVICE_INSTANCE_REQUEST);
if (ctx.contextKeys.get(GET_SERVICE_INSTANCE_RESPONSE) instanceof GetServiceInstanceResponse) {
response = (GetServiceInstanceResponse) ctx.contextKeys.get(GET_SERVICE_INSTANCE_RESPONSE);
} else {
response = GetServiceInstanceResponse.builder().build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public void uses_getinstance_response_from_context_when_set() {
BrokerProcessor processor = new DefaultBrokerProcessor() {
@Override
public void preGetInstance(Context ctx) {
ctx.contextKeys.put(ProcessorChainServiceInstanceService.GET_SERVICE_INSTANCE_REQUEST, customResponse);
ctx.contextKeys.put(ProcessorChainServiceInstanceService.GET_SERVICE_INSTANCE_RESPONSE, customResponse);
}
};
processorChain = aProcessorChain(processor);
Expand Down

0 comments on commit 3fc37fb

Please sign in to comment.