The controller class (controller.java) has this code. if (farmerIds.contains(farmerId)) { farmerUnionRequest farmerUnionRequest = new farmerUnionRequest(farmerId, customerId); String encryptedRequest = encryptor.encrypt(StringUtil.toJsonString(farmerUnionRequest)); response = redirectService.getConfirmAccountResponse(headers, ImmutableMap.of("encryptedUnionId", encryptedRequest)); } else { LOG.warn("Unknown farmer id: {}", farmerId); response = new ResponseEntity("Unknown farmer id", BAD_REQUEST); } I noticed that there is another main field called customerId and it is not checked for null or empty. I changed the controller class like this. if (farmerIds.contains(farmerId)) { if (!customerId.isEmp...