### Question:
SubscribeSender { public String send(final EsrSystemInfo info, final LccnSubscriptionRequest request) throws VeVnfmException { final ResponseEntity<SubscribeToManoResponse> response = restProvider.postHttpRequest(request, getUrl(info), SubscribeToManoResponse.class); final HttpStatus statusCode = response.getStatusCode(); final SubscribeToManoResponse body = response.getBody(); logger.info("The VNFM replied with the code {} and the body {}", statusCode, body); if (HttpStatus.CREATED != statusCode) { throw new VeVnfmException("The status code was different than " + HttpStatus.CREATED); } return body.id; } @Autowired  SubscribeSender(final ConfigProperties configProperties, final HttpRestServiceProvider restProvider); String send(final EsrSystemInfo info, final LccnSubscriptionRequest request); boolean check(final EsrSystemInfo info, final String id); static final String SLASH; }### Answer:
@Test public void testSuccess() throws VeVnfmException { final EsrSystemInfo info = new EsrSystemInfo(); info.setServiceUrl(URL); final LccnSubscriptionRequest request = new LccnSubscriptionRequest(); mockRestServer.expect(once(), requestTo(SLASH + info.getServiceUrl() + vnfmSubscription)) .andExpect(header(CONTENT_TYPE, CoreMatchers.containsString(MediaType.APPLICATION_JSON_VALUE))) .andExpect(method(HttpMethod.POST)).andExpect(content().json(GSON.toJson(request))) .andRespond(withStatus(HttpStatus.CREATED).body(JSON).contentType(MediaType.APPLICATION_JSON)); final String id = sender.send(info, request); mockRestServer.verify(); assertEquals(ID, id); }