Created
August 7, 2023 02:51
-
-
Save A-pZ/1038dcda9ee6a2dae96761cea129b54a to your computer and use it in GitHub Desktop.
取引先の削除処理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void delete(String objectId, AuthenticationResult authenticationResult) { | |
salesforceWebClient.delete() // 削除はDELETE | |
.uri( salesforceProperties.getApplicationPath()+ "/sobjects/Account/" + objectId) // 更新同様、削除するオブジェクトIDを指定 | |
.header("Authorization", authenticationResult.bearerToken()) | |
.retrieve() | |
.bodyToMono(Company.class) | |
.block(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.apz.salesforcesample.repository | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.boot.test.context.SpringBootTest | |
import spock.lang.Specification | |
@SpringBootTest | |
class SalesforceDeleteTest extends Specification { | |
@Autowired | |
SalesforceAuthentication authentication | |
@Autowired | |
CompanyRepository repository | |
def "削除"() { | |
when: | |
def authenticationResult = authentication.authentication() | |
repository.delete("0010l00001dKU2XAAW", authenticationResult) | |
then: | |
noExceptionThrown() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment