### Question:
RequestFactory implements Serializable { public EntityRequest createPersistApplicationRequest(final Store store, final JsonObject app) { final EntityRequest request = new EntityRequest( Method.POST, this.getUrl(store, URL_APPS)); final NStringEntity entity = new NStringEntity(app.toString(), CHARSET); request.setEntity(entity); request.setHeader(Headers.CONTENT_TYPE, APPLICATION_JSON); return request; } RequestFactory(); EntityRequest createLoginRequest(final Store store); EntityRequest createLogoutRequest(final Store store); EntityRequest createLanguageRequest(final Store store); EntityRequest createAppStoreItemsRequest(final Store store); ZeroCopyFileRequest createUploadRequest(final Store store, final File file); ZeroCopyFileRequest createUploadAppRequest(
            final Store store,
            final String releaseStatus,
            final boolean archivePreviousVersion,
            final String environmentUuid); EntityRequest createAppFromFileRequest(final Store store, final JsonObject asset); EntityRequest createPersistApplicationRequest(final Store store, final JsonObject app); EntityRequest createPersistVersionRequest(final Store store, final JsonObject app, final JsonObject version); EntityRequest createDeleteVersionRequest(final Store store, final JsonObject version);  }### Answer:
@Test public void shouldCreatePersistAppRequestFromHostName() { this.store.setUrl(URL_HOST_NAME); final JsonObject app = new JsonObject(); app.addProperty("appUuid", "{app-uuid}"); final EntityRequest request = this.requestFactory.createPersistApplicationRequest(this.store, app); assertThat(request).isNotNull(); assertThat(request.getMethod()).isEqualTo(Method.POST); assertThat(request.getUri()).isEqualTo("https: }
@Test public void shouldCreatePersistAppRequestFromApiUrl() { this.store.setUrl(URL_API_URL); final JsonObject app = new JsonObject(); app.addProperty("uuid", "{app-uuid}"); final EntityRequest request = this.requestFactory.createPersistApplicationRequest(this.store, app); assertThat(request).isNotNull(); assertThat(request.getMethod()).isEqualTo(Method.POST); assertThat(request.getUri()).isEqualTo("https: }