@Test public void getStatusCodeCreated() { Assert.assertEquals( "201 Created", bundleResourceProvider.getStatus( new FhirOperationResult( FhirOperationResult.CREATED_STATUS_CODE ) ) ); }
@Nonnull protected String getStatus( @Nonnull FhirOperationResult result ) { final String statusMessage; switch ( result.getStatusCode() ) { case FhirOperationResult.OK_STATUS_CODE: statusMessage = "OK"; break; case FhirOperationResult.NO_CONTENT_STATUS_CODE: statusMessage = "No content"; break; case FhirOperationResult.CREATED_STATUS_CODE: statusMessage = "Created"; break; case FhirOperationResult.BAD_REQUEST_STATUS_CODE: statusMessage = "Bad request"; break; case FhirOperationResult.UNAUTHORIZED_STATUS_CODE: statusMessage = "Unauthorized"; break; case FhirOperationResult.FORBIDDEN_STATUS_CODE: statusMessage = "Forbidden"; break; case FhirOperationResult.NOT_FOUND_STATUS_CODE: statusMessage = "Not found"; break; case FhirOperationResult.UNPROCESSABLE_ENTITY_STATUS_CODE: statusMessage = "Unprocessable entity"; break; case FhirOperationResult.INTERNAL_SERVER_ERROR_STATUS_CODE: statusMessage = "Internal server error"; break; default: statusMessage = "Unknown"; } return result.getStatusCode() + " " + statusMessage; }
AbstractBundleResourceProvider extends AbstractUntypedResourceProvider { @Nonnull protected String getStatus( @Nonnull FhirOperationResult result ) { final String statusMessage; switch ( result.getStatusCode() ) { case FhirOperationResult.OK_STATUS_CODE: statusMessage = "OK"; break; case FhirOperationResult.NO_CONTENT_STATUS_CODE: statusMessage = "No content"; break; case FhirOperationResult.CREATED_STATUS_CODE: statusMessage = "Created"; break; case FhirOperationResult.BAD_REQUEST_STATUS_CODE: statusMessage = "Bad request"; break; case FhirOperationResult.UNAUTHORIZED_STATUS_CODE: statusMessage = "Unauthorized"; break; case FhirOperationResult.FORBIDDEN_STATUS_CODE: statusMessage = "Forbidden"; break; case FhirOperationResult.NOT_FOUND_STATUS_CODE: statusMessage = "Not found"; break; case FhirOperationResult.UNPROCESSABLE_ENTITY_STATUS_CODE: statusMessage = "Unprocessable entity"; break; case FhirOperationResult.INTERNAL_SERVER_ERROR_STATUS_CODE: statusMessage = "Internal server error"; break; default: statusMessage = "Unknown"; } return result.getStatusCode() + " " + statusMessage; } }
AbstractBundleResourceProvider extends AbstractUntypedResourceProvider { @Nonnull protected String getStatus( @Nonnull FhirOperationResult result ) { final String statusMessage; switch ( result.getStatusCode() ) { case FhirOperationResult.OK_STATUS_CODE: statusMessage = "OK"; break; case FhirOperationResult.NO_CONTENT_STATUS_CODE: statusMessage = "No content"; break; case FhirOperationResult.CREATED_STATUS_CODE: statusMessage = "Created"; break; case FhirOperationResult.BAD_REQUEST_STATUS_CODE: statusMessage = "Bad request"; break; case FhirOperationResult.UNAUTHORIZED_STATUS_CODE: statusMessage = "Unauthorized"; break; case FhirOperationResult.FORBIDDEN_STATUS_CODE: statusMessage = "Forbidden"; break; case FhirOperationResult.NOT_FOUND_STATUS_CODE: statusMessage = "Not found"; break; case FhirOperationResult.UNPROCESSABLE_ENTITY_STATUS_CODE: statusMessage = "Unprocessable entity"; break; case FhirOperationResult.INTERNAL_SERVER_ERROR_STATUS_CODE: statusMessage = "Internal server error"; break; default: statusMessage = "Unknown"; } return result.getStatusCode() + " " + statusMessage; } AbstractBundleResourceProvider(
        @Nonnull FhirClientResourceRepository fhirClientResourceRepository,
        @Nonnull FhirClientSystemRepository fhirClientSystemRepository,
        @Nonnull FhirRepository fhirRepository, @Nonnull DhisRepository dhisRepository,
        @Nonnull RequestCacheService requestCacheService ); }
AbstractBundleResourceProvider extends AbstractUntypedResourceProvider { @Nonnull protected String getStatus( @Nonnull FhirOperationResult result ) { final String statusMessage; switch ( result.getStatusCode() ) { case FhirOperationResult.OK_STATUS_CODE: statusMessage = "OK"; break; case FhirOperationResult.NO_CONTENT_STATUS_CODE: statusMessage = "No content"; break; case FhirOperationResult.CREATED_STATUS_CODE: statusMessage = "Created"; break; case FhirOperationResult.BAD_REQUEST_STATUS_CODE: statusMessage = "Bad request"; break; case FhirOperationResult.UNAUTHORIZED_STATUS_CODE: statusMessage = "Unauthorized"; break; case FhirOperationResult.FORBIDDEN_STATUS_CODE: statusMessage = "Forbidden"; break; case FhirOperationResult.NOT_FOUND_STATUS_CODE: statusMessage = "Not found"; break; case FhirOperationResult.UNPROCESSABLE_ENTITY_STATUS_CODE: statusMessage = "Unprocessable entity"; break; case FhirOperationResult.INTERNAL_SERVER_ERROR_STATUS_CODE: statusMessage = "Internal server error"; break; default: statusMessage = "Unknown"; } return result.getStatusCode() + " " + statusMessage; } AbstractBundleResourceProvider(
        @Nonnull FhirClientResourceRepository fhirClientResourceRepository,
        @Nonnull FhirClientSystemRepository fhirClientSystemRepository,
        @Nonnull FhirRepository fhirRepository, @Nonnull DhisRepository dhisRepository,
        @Nonnull RequestCacheService requestCacheService );  }
AbstractBundleResourceProvider extends AbstractUntypedResourceProvider { @Nonnull protected String getStatus( @Nonnull FhirOperationResult result ) { final String statusMessage; switch ( result.getStatusCode() ) { case FhirOperationResult.OK_STATUS_CODE: statusMessage = "OK"; break; case FhirOperationResult.NO_CONTENT_STATUS_CODE: statusMessage = "No content"; break; case FhirOperationResult.CREATED_STATUS_CODE: statusMessage = "Created"; break; case FhirOperationResult.BAD_REQUEST_STATUS_CODE: statusMessage = "Bad request"; break; case FhirOperationResult.UNAUTHORIZED_STATUS_CODE: statusMessage = "Unauthorized"; break; case FhirOperationResult.FORBIDDEN_STATUS_CODE: statusMessage = "Forbidden"; break; case FhirOperationResult.NOT_FOUND_STATUS_CODE: statusMessage = "Not found"; break; case FhirOperationResult.UNPROCESSABLE_ENTITY_STATUS_CODE: statusMessage = "Unprocessable entity"; break; case FhirOperationResult.INTERNAL_SERVER_ERROR_STATUS_CODE: statusMessage = "Internal server error"; break; default: statusMessage = "Unknown"; } return result.getStatusCode() + " " + statusMessage; } AbstractBundleResourceProvider(
        @Nonnull FhirClientResourceRepository fhirClientResourceRepository,
        @Nonnull FhirClientSystemRepository fhirClientSystemRepository,
        @Nonnull FhirRepository fhirRepository, @Nonnull DhisRepository dhisRepository,
        @Nonnull RequestCacheService requestCacheService );   }