test_class.declarator: VEN_URL = "/Ven/"
test_class.modifier: private static final
test_class.original_string: private static final String VEN_URL = "/Ven/";
test_class.type: String
test_class.var_name: VEN_URL
test_class.declarator: GROUP_URL = "/Group/"
test_class.modifier: private static final
test_class.original_string: private static final String GROUP_URL = "/Group/";
test_class.type: String
test_class.var_name: GROUP_URL
test_class.declarator: MARKET_CONTEXT_URL = "/MarketContext/"
test_class.modifier: private static final
test_class.original_string: private static final String MARKET_CONTEXT_URL = "/MarketContext/";
test_class.type: String
test_class.var_name: MARKET_CONTEXT_URL
test_class.declarator: wac
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private WebApplicationContext wac;
test_class.type: WebApplicationContext
test_class.var_name: wac
test_class.declarator: springSecurityFilterChain
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private Filter springSecurityFilterChain;
test_class.type: Filter
test_class.var_name: springSecurityFilterChain
test_class.declarator: mockMvc
test_class.modifier: private
test_class.original_string: private MockMvc mockMvc;
test_class.type: MockMvc
test_class.var_name: mockMvc
test_class.declarator: mapper = new ObjectMapper()
test_class.modifier: private
test_class.original_string: private ObjectMapper mapper = new ObjectMapper();
test_class.type: ObjectMapper
test_class.var_name: mapper
test_class.declarator: adminSession = SecurityMockMvcRequestPostProcessors.user("admin").roles("ADMIN")
test_class.modifier: private
test_class.original_string: private UserRequestPostProcessor adminSession = SecurityMockMvcRequestPostProcessors.user("admin").roles("ADMIN");
test_class.type: UserRequestPostProcessor
test_class.var_name: adminSession
test_class.declarator: venSession = SecurityMockMvcRequestPostProcessors.user("ven1").roles("VEN")
test_class.modifier: private
test_class.original_string: private UserRequestPostProcessor venSession = SecurityMockMvcRequestPostProcessors.user("ven1").roles("VEN");
test_class.type: UserRequestPostProcessor
test_class.var_name: venSession
test_class.declarator: userSession = SecurityMockMvcRequestPostProcessors.user("ven1").roles("USER")
test_class.modifier: private
test_class.original_string: private UserRequestPostProcessor userSession = SecurityMockMvcRequestPostProcessors.user("ven1").roles("USER");
test_class.type: UserRequestPostProcessor
test_class.var_name: userSession
test_class.declarator: venService
test_class.modifier: @Resource
  	private
test_class.original_string: @Resource
  	private VenService venService;
test_class.type: VenService
test_class.var_name: venService
test_class.file: OpenADRServerVTNCommon/src/test/java/com/avob/openadr/server/common/vtn/controller/VenControllerTest.java
test_class.identifier: VenControllerTest
test_case.body: @Test
  	public void cleanRegistrationTest() throws Exception {
  
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(VEN_URL + "mouaiccool/cleanRegistration")
  						.header("Content-Type", "application/json").with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.NOT_FOUND_404));
  
  		Ven prepare = venService.prepare("ven1");
  		prepare.setRegistrationId("mouaiccool");
  		venService.save(prepare);
  
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(VEN_URL + "ven1/cleanRegistration")
  						.header("Content-Type", "application/json").with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.OK_200));
  
  		Ven findOneByUsername = venService.findOneByUsername("ven1");
  		assertNull(findOneByUsername.getRegistrationId());
  		venService.delete(findOneByUsername);
  	}
test_case.class_method_signature: VenControllerTest.cleanRegistrationTest()
test_case.full_signature: @Test public void cleanRegistrationTest()
test_case.identifier: cleanRegistrationTest
test_case.invocations: andExpect perform with header post is status prepare setRegistrationId save andExpect perform with header post is status findOneByUsername assertNull getRegistrationId delete
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void cleanRegistrationTest()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(VenController.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(VenController.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: venService
focal_class.modifier: @Resource
  	private
focal_class.original_string: @Resource
  	private VenService venService;
focal_class.type: VenService
focal_class.var_name: venService
focal_class.declarator: venResourceService
focal_class.modifier: @Resource
  	private
focal_class.original_string: @Resource
  	private VenResourceService venResourceService;
focal_class.type: VenResourceService
focal_class.var_name: venResourceService
focal_class.declarator: venGroupService
focal_class.modifier: @Resource
  	private
focal_class.original_string: @Resource
  	private VenGroupService venGroupService;
focal_class.type: VenGroupService
focal_class.var_name: venGroupService
focal_class.declarator: venMarketContextService
focal_class.modifier: @Resource
  	private
focal_class.original_string: @Resource
  	private VenMarketContextService venMarketContextService;
focal_class.type: VenMarketContextService
focal_class.var_name: venMarketContextService
focal_class.declarator: dtoMapper
focal_class.modifier: @Resource
  	private
focal_class.original_string: @Resource
  	private DtoMapper dtoMapper;
focal_class.type: DtoMapper
focal_class.var_name: dtoMapper
focal_class.file: OpenADRServerVTNCommon/src/main/java/com/avob/openadr/server/common/vtn/controller/VenController.java
focal_class.identifier: VenController
focal_class.class_method_signature: VenController.listVen()
focal_class.full_signature: @RequestMapping(value = "/", method = RequestMethod.GET) @ResponseBody public List<VenDto> listVen()
focal_class.identifier: listVen
focal_class.modifiers: @RequestMapping(value = "/", method = RequestMethod.GET) @ResponseBody public
focal_class.parameters: ()
focal_class.return: List<VenDto>
focal_class.signature: List<VenDto> listVen()
focal_class.class_method_signature: VenController.searchVen(@RequestBody List<VenFilter> filters, @RequestParam("page") int page,
  			@RequestParam("size") int size, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/search", method = RequestMethod.POST) @ResponseBody public List<VenDto> searchVen(@RequestBody List<VenFilter> filters, @RequestParam("page") int page,
  			@RequestParam("size") int size, HttpServletResponse response)
focal_class.identifier: searchVen
focal_class.modifiers: @RequestMapping(value = "/search", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@RequestBody List<VenFilter> filters, @RequestParam("page") int page,
  			@RequestParam("size") int size, HttpServletResponse response)
focal_class.return: List<VenDto>
focal_class.signature: List<VenDto> searchVen(@RequestBody List<VenFilter> filters, @RequestParam("page") int page,
  			@RequestParam("size") int size, HttpServletResponse response)
focal_class.class_method_signature: VenController.createVen(@Valid @RequestBody VenCreateDto dto,
  			HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/", method = RequestMethod.POST) @ResponseBody public ResponseEntity<InputStreamResource> createVen(@Valid @RequestBody VenCreateDto dto,
  			HttpServletResponse response)
focal_class.identifier: createVen
focal_class.modifiers: @RequestMapping(value = "/", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@Valid @RequestBody VenCreateDto dto,
  			HttpServletResponse response)
focal_class.return: ResponseEntity<InputStreamResource>
focal_class.signature: ResponseEntity<InputStreamResource> createVen(@Valid @RequestBody VenCreateDto dto,
  			HttpServletResponse response)
focal_class.class_method_signature: VenController.updateVen(@PathVariable("venID") String venUsername, @Valid @RequestBody VenUpdateDto dto,
  			HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}", method = RequestMethod.PUT) @ResponseBody public VenCreateDto updateVen(@PathVariable("venID") String venUsername, @Valid @RequestBody VenUpdateDto dto,
  			HttpServletResponse response)
focal_class.identifier: updateVen
focal_class.modifiers: @RequestMapping(value = "/{venID}", method = RequestMethod.PUT) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername, @Valid @RequestBody VenUpdateDto dto,
  			HttpServletResponse response)
focal_class.return: VenCreateDto
focal_class.signature: VenCreateDto updateVen(@PathVariable("venID") String venUsername, @Valid @RequestBody VenUpdateDto dto,
  			HttpServletResponse response)
focal_class.class_method_signature: VenController.findVenByUsername(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}", method = RequestMethod.GET) @ResponseBody public VenDto findVenByUsername(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.identifier: findVenByUsername
focal_class.modifiers: @RequestMapping(value = "/{venID}", method = RequestMethod.GET) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.return: VenDto
focal_class.signature: VenDto findVenByUsername(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.class_method_signature: VenController.deleteVenByUsername(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}", method = RequestMethod.DELETE) @ResponseBody public void deleteVenByUsername(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.identifier: deleteVenByUsername
focal_class.modifiers: @RequestMapping(value = "/{venID}", method = RequestMethod.DELETE) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.return: void
focal_class.signature: void deleteVenByUsername(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.class_method_signature: VenController.createVenResource(@PathVariable("venID") String venUsername, @RequestBody VenResourceDto dto,
  			HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}/resource", method = RequestMethod.POST) @ResponseBody public VenResourceDto createVenResource(@PathVariable("venID") String venUsername, @RequestBody VenResourceDto dto,
  			HttpServletResponse response)
focal_class.identifier: createVenResource
focal_class.modifiers: @RequestMapping(value = "/{venID}/resource", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername, @RequestBody VenResourceDto dto,
  			HttpServletResponse response)
focal_class.return: VenResourceDto
focal_class.signature: VenResourceDto createVenResource(@PathVariable("venID") String venUsername, @RequestBody VenResourceDto dto,
  			HttpServletResponse response)
focal_class.class_method_signature: VenController.listVenResource(@PathVariable("venID") String venUsername,
  			HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}/resource", method = RequestMethod.GET) @ResponseBody public List<VenResourceDto> listVenResource(@PathVariable("venID") String venUsername,
  			HttpServletResponse response)
focal_class.identifier: listVenResource
focal_class.modifiers: @RequestMapping(value = "/{venID}/resource", method = RequestMethod.GET) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername,
  			HttpServletResponse response)
focal_class.return: List<VenResourceDto>
focal_class.signature: List<VenResourceDto> listVenResource(@PathVariable("venID") String venUsername,
  			HttpServletResponse response)
focal_class.class_method_signature: VenController.deleteVenResource(@PathVariable("venID") String venUsername,
  			@PathVariable("resourceName") String resourceName, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}/resource/{resourceName}", method = RequestMethod.DELETE) @ResponseBody public void deleteVenResource(@PathVariable("venID") String venUsername,
  			@PathVariable("resourceName") String resourceName, HttpServletResponse response)
focal_class.identifier: deleteVenResource
focal_class.modifiers: @RequestMapping(value = "/{venID}/resource/{resourceName}", method = RequestMethod.DELETE) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername,
  			@PathVariable("resourceName") String resourceName, HttpServletResponse response)
focal_class.return: void
focal_class.signature: void deleteVenResource(@PathVariable("venID") String venUsername,
  			@PathVariable("resourceName") String resourceName, HttpServletResponse response)
focal_class.class_method_signature: VenController.addGroupToVen(@PathVariable("venID") String venUsername, @RequestParam("groupId") Long groupId,
  			HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}/group", method = RequestMethod.POST) @ResponseBody public VenCreateDto addGroupToVen(@PathVariable("venID") String venUsername, @RequestParam("groupId") Long groupId,
  			HttpServletResponse response)
focal_class.identifier: addGroupToVen
focal_class.modifiers: @RequestMapping(value = "/{venID}/group", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername, @RequestParam("groupId") Long groupId,
  			HttpServletResponse response)
focal_class.return: VenCreateDto
focal_class.signature: VenCreateDto addGroupToVen(@PathVariable("venID") String venUsername, @RequestParam("groupId") Long groupId,
  			HttpServletResponse response)
focal_class.class_method_signature: VenController.listVenGroup(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}/group", method = RequestMethod.GET) @ResponseBody public List<VenGroupDto> listVenGroup(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.identifier: listVenGroup
focal_class.modifiers: @RequestMapping(value = "/{venID}/group", method = RequestMethod.GET) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.return: List<VenGroupDto>
focal_class.signature: List<VenGroupDto> listVenGroup(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.class_method_signature: VenController.deleteVenGroup(@PathVariable("venID") String venUsername, @RequestParam("groupId") Long groupId,
  			HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}/group/remove", method = RequestMethod.POST) @ResponseBody public void deleteVenGroup(@PathVariable("venID") String venUsername, @RequestParam("groupId") Long groupId,
  			HttpServletResponse response)
focal_class.identifier: deleteVenGroup
focal_class.modifiers: @RequestMapping(value = "/{venID}/group/remove", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername, @RequestParam("groupId") Long groupId,
  			HttpServletResponse response)
focal_class.return: void
focal_class.signature: void deleteVenGroup(@PathVariable("venID") String venUsername, @RequestParam("groupId") Long groupId,
  			HttpServletResponse response)
focal_class.class_method_signature: VenController.addMarketContextToVen(@PathVariable("venID") String venUsername,
  			@RequestParam("marketContextId") Long marketContextId, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}/marketContext", method = RequestMethod.POST) @ResponseBody public VenCreateDto addMarketContextToVen(@PathVariable("venID") String venUsername,
  			@RequestParam("marketContextId") Long marketContextId, HttpServletResponse response)
focal_class.identifier: addMarketContextToVen
focal_class.modifiers: @RequestMapping(value = "/{venID}/marketContext", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername,
  			@RequestParam("marketContextId") Long marketContextId, HttpServletResponse response)
focal_class.return: VenCreateDto
focal_class.signature: VenCreateDto addMarketContextToVen(@PathVariable("venID") String venUsername,
  			@RequestParam("marketContextId") Long marketContextId, HttpServletResponse response)
focal_class.class_method_signature: VenController.listVenMarketContext(@PathVariable("venID") String venUsername,
  			HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}/marketContext", method = RequestMethod.GET) @ResponseBody public List<VenMarketContextDto> listVenMarketContext(@PathVariable("venID") String venUsername,
  			HttpServletResponse response)
focal_class.identifier: listVenMarketContext
focal_class.modifiers: @RequestMapping(value = "/{venID}/marketContext", method = RequestMethod.GET) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername,
  			HttpServletResponse response)
focal_class.return: List<VenMarketContextDto>
focal_class.signature: List<VenMarketContextDto> listVenMarketContext(@PathVariable("venID") String venUsername,
  			HttpServletResponse response)
focal_class.class_method_signature: VenController.deleteVenMarketContext(@PathVariable("venID") String venUsername,
  			@RequestParam("marketContextId") Long marketContextId, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}/marketContext/remove", method = RequestMethod.POST) @ResponseBody public void deleteVenMarketContext(@PathVariable("venID") String venUsername,
  			@RequestParam("marketContextId") Long marketContextId, HttpServletResponse response)
focal_class.identifier: deleteVenMarketContext
focal_class.modifiers: @RequestMapping(value = "/{venID}/marketContext/remove", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername,
  			@RequestParam("marketContextId") Long marketContextId, HttpServletResponse response)
focal_class.return: void
focal_class.signature: void deleteVenMarketContext(@PathVariable("venID") String venUsername,
  			@RequestParam("marketContextId") Long marketContextId, HttpServletResponse response)
focal_class.class_method_signature: VenController.cleanRegistration(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{venID}/cleanRegistration", method = RequestMethod.POST) @ResponseBody public void cleanRegistration(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.identifier: cleanRegistration
focal_class.modifiers: @RequestMapping(value = "/{venID}/cleanRegistration", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_class.return: void
focal_class.signature: void cleanRegistration(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_method.body: @RequestMapping(value = "/{venID}/cleanRegistration", method = RequestMethod.POST)
  	@ResponseBody
  	public void cleanRegistration(@PathVariable("venID") String venUsername, HttpServletResponse response) {
  		Ven ven = venService.findOneByUsername(venUsername);
  		if (ven == null) {
  			LOGGER.warn("Unknown Ven: " + venUsername);
  			response.setStatus(HttpStatus.NOT_FOUND_404);
  			return;
  		}
  		venService.cleanRegistration(ven);
  		response.setStatus(HttpStatus.OK_200);
  		LOGGER.info("Clean registration of Ven: " + ven.getUsername());
  	}
focal_method.class_method_signature: VenController.cleanRegistration(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_method.full_signature: @RequestMapping(value = "/{venID}/cleanRegistration", method = RequestMethod.POST) @ResponseBody public void cleanRegistration(@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_method.identifier: cleanRegistration
focal_method.invocations: findOneByUsername warn setStatus cleanRegistration setStatus info getUsername
focal_method.modifiers: @RequestMapping(value = "/{venID}/cleanRegistration", method = RequestMethod.POST) @ResponseBody public
focal_method.parameters: (@PathVariable("venID") String venUsername, HttpServletResponse response)
focal_method.return: void
focal_method.signature: void cleanRegistration(@PathVariable("venID") String venUsername, HttpServletResponse response)