WorldpayOccApiController { @GetMapping(value = "/cse-public-key", produces = "application/json") public String getCsePublicKey() { return worldpayMerchantConfigDataFacade.getCurrentSiteMerchantConfigData().getCsePublicKey(); }  @GetMapping(value = "/cse-public-key", produces = "application/json") String getCsePublicKey();  }
@Test public void getCsePublicKey_WhenItIsCalled_ReturnsTheCSEPublicKey() { when(worldpayMerchantConfigDataFacadeMock.getCurrentSiteMerchantConfigData().getCsePublicKey()).thenReturn(CSE_PUBLIC_KEY); final String result = testObj.getCsePublicKey(); assertThat(result).isEqualTo(CSE_PUBLIC_KEY); }