test_class.declarator: ACCOUNT_URL = "/Account/"
test_class.modifier: private static final
test_class.original_string: private static final String ACCOUNT_URL = "/Account/";
test_class.type: String
test_class.var_name: ACCOUNT_URL
test_class.declarator: ACCOUNT_USER_URL = ACCOUNT_URL + "/user"
test_class.modifier: private static final
test_class.original_string: private static final String ACCOUNT_USER_URL = ACCOUNT_URL + "/user";
test_class.type: String
test_class.var_name: ACCOUNT_USER_URL
test_class.declarator: ACCOUNT_APP_URL = ACCOUNT_URL + "/app"
test_class.modifier: private static final
test_class.original_string: private static final String ACCOUNT_APP_URL = ACCOUNT_URL + "/app";
test_class.type: String
test_class.var_name: ACCOUNT_APP_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: dozerMapper
test_class.modifier: @Resource
  	private
test_class.original_string: @Resource
  	private DtoMapper dozerMapper;
test_class.type: DtoMapper
test_class.var_name: dozerMapper
test_class.declarator: oadrUserService
test_class.modifier: @Resource
  	private
test_class.original_string: @Resource
  	private OadrUserService oadrUserService;
test_class.type: OadrUserService
test_class.var_name: oadrUserService
test_class.declarator: oadrAppService
test_class.modifier: @Resource
  	private
test_class.original_string: @Resource
  	private OadrAppService oadrAppService;
test_class.type: OadrAppService
test_class.var_name: oadrAppService
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: adminUser = null
test_class.modifier: private
test_class.original_string: private OadrUser adminUser = null;
test_class.type: OadrUser
test_class.var_name: adminUser
test_class.declarator: appUser = null
test_class.modifier: private
test_class.original_string: private OadrApp appUser = null;
test_class.type: OadrApp
test_class.var_name: appUser
test_class.declarator: admin = SecurityMockMvcRequestPostProcessors.user("admin").roles("ADMIN")
test_class.modifier: private
test_class.original_string: private UserRequestPostProcessor admin = SecurityMockMvcRequestPostProcessors.user("admin").roles("ADMIN");
test_class.type: UserRequestPostProcessor
test_class.var_name: admin
test_class.declarator: app = SecurityMockMvcRequestPostProcessors.user("app").roles("DEVICE_MANAGER")
test_class.modifier: private
test_class.original_string: private UserRequestPostProcessor app = SecurityMockMvcRequestPostProcessors.user("app").roles("DEVICE_MANAGER");
test_class.type: UserRequestPostProcessor
test_class.var_name: app
test_class.declarator: user = SecurityMockMvcRequestPostProcessors.user("user").roles("USER")
test_class.modifier: private
test_class.original_string: private UserRequestPostProcessor user = SecurityMockMvcRequestPostProcessors.user("user").roles("USER");
test_class.type: UserRequestPostProcessor
test_class.var_name: user
test_class.declarator: appListRef = new TypeReference<List<OadrAppDto>>() {
  	}
test_class.modifier: private
test_class.original_string: private TypeReference<List<OadrAppDto>> appListRef = new TypeReference<List<OadrAppDto>>() {
  	};
test_class.type: TypeReference<List<OadrAppDto>>
test_class.var_name: appListRef
test_class.declarator: userListRef = new TypeReference<List<OadrUserDto>>() {
  	}
test_class.modifier: private
test_class.original_string: private TypeReference<List<OadrUserDto>> userListRef = new TypeReference<List<OadrUserDto>>() {
  	};
test_class.type: TypeReference<List<OadrUserDto>>
test_class.var_name: userListRef
test_class.file: OpenADRServerVTNCommon/src/test/java/com/avob/openadr/server/common/vtn/controller/AccountControllerTest.java
test_class.identifier: AccountControllerTest
test_case.body: @Test
  	public void deleteUserTest() throws Exception {
  
  		// no authorization
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.delete(ACCOUNT_USER_URL + "/mouaiccool")
  						.header("Content-Type", "application/json").with(user))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.FORBIDDEN_403));
  
  		// delete unknown user account
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.delete(ACCOUNT_USER_URL + "/mouaiccool")
  						.header("Content-Type", "application/json").with(admin))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.NOT_FOUND_404));
  
  		// create login auth user no certificate gen
  		OadrUserCreateDto dto = new OadrUserCreateDto();
  		dto.setCommonName("myuser");
  		dto.setUsername("myuser");
  		dto.setAuthenticationType("login");
  		dto.setPassword("pass");
  		byte[] content = mapper.writeValueAsBytes(dto);
  		MvcResult andReturn = this.mockMvc
  				.perform(MockMvcRequestBuilders.post(ACCOUNT_USER_URL).content(content)
  						.header("Content-Type", "application/json").with(admin))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.CREATED_201)).andReturn();
  		assertEquals(0, andReturn.getResponse().getContentLength());
  
  		// verify user has been created
  		OadrUser findByUsername = oadrUserService.findByUsername("myuser");
  		assertNotNull(findByUsername);
  
  		// delete user account
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.delete(ACCOUNT_USER_URL + "/myuser")
  						.header("Content-Type", "application/json").with(admin))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.OK_200));
  
  		// verify user has been deleted
  		findByUsername = oadrUserService.findByUsername("myuser");
  		assertNull(findByUsername);
  	}
test_case.class_method_signature: AccountControllerTest.deleteUserTest()
test_case.full_signature: @Test public void deleteUserTest()
test_case.identifier: deleteUserTest
test_case.invocations: andExpect perform with header delete is status andExpect perform with header delete is status setCommonName setUsername setAuthenticationType setPassword writeValueAsBytes andReturn andExpect perform with header content post is status assertEquals getContentLength getResponse findByUsername assertNotNull andExpect perform with header delete is status findByUsername assertNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void deleteUserTest()
focal_class.declarator: OCTET_STREAM_MEDIA_TYPE = MediaType.parseMediaType("application/octet-stream")
focal_class.modifier: private static final
focal_class.original_string: private static final MediaType OCTET_STREAM_MEDIA_TYPE = MediaType.parseMediaType("application/octet-stream");
focal_class.type: MediaType
focal_class.var_name: OCTET_STREAM_MEDIA_TYPE
focal_class.declarator: LOGGER = LoggerFactory.getLogger(AccountController.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(AccountController.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
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.declarator: abstractUserDao
focal_class.modifier: @Resource
  	private
focal_class.original_string: @Resource
  	private AbstractUserDao abstractUserDao;
focal_class.type: AbstractUserDao
focal_class.var_name: abstractUserDao
focal_class.declarator: oadrUserService
focal_class.modifier: @Resource
  	private
focal_class.original_string: @Resource
  	private OadrUserService oadrUserService;
focal_class.type: OadrUserService
focal_class.var_name: oadrUserService
focal_class.declarator: oadrAppService
focal_class.modifier: @Resource
  	private
focal_class.original_string: @Resource
  	private OadrAppService oadrAppService;
focal_class.type: OadrAppService
focal_class.var_name: oadrAppService
focal_class.file: OpenADRServerVTNCommon/src/main/java/com/avob/openadr/server/common/vtn/controller/AccountController.java
focal_class.identifier: AccountController
focal_class.class_method_signature: AccountController.registeredUser(Principal principal)
focal_class.full_signature: @RequestMapping(value = "/", method = RequestMethod.GET) @ResponseBody @PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVICE_MANAGER') or hasRole('ROLE_DRPROGRAM')") public AbstractUserWithRoleDto registeredUser(Principal principal)
focal_class.identifier: registeredUser
focal_class.modifiers: @RequestMapping(value = "/", method = RequestMethod.GET) @ResponseBody @PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVICE_MANAGER') or hasRole('ROLE_DRPROGRAM')") public
focal_class.parameters: (Principal principal)
focal_class.return: AbstractUserWithRoleDto
focal_class.signature: AbstractUserWithRoleDto registeredUser(Principal principal)
focal_class.class_method_signature: AccountController.listUser()
focal_class.full_signature: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/user", method = RequestMethod.GET) @ResponseBody public List<OadrUserDto> listUser()
focal_class.identifier: listUser
focal_class.modifiers: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/user", method = RequestMethod.GET) @ResponseBody public
focal_class.parameters: ()
focal_class.return: List<OadrUserDto>
focal_class.signature: List<OadrUserDto> listUser()
focal_class.class_method_signature: AccountController.createUser(@RequestBody OadrUserCreateDto dto,
  			HttpServletResponse response)
focal_class.full_signature: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/user", method = RequestMethod.POST) @ResponseBody public ResponseEntity<InputStreamResource> createUser(@RequestBody OadrUserCreateDto dto,
  			HttpServletResponse response)
focal_class.identifier: createUser
focal_class.modifiers: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/user", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@RequestBody OadrUserCreateDto dto,
  			HttpServletResponse response)
focal_class.return: ResponseEntity<InputStreamResource>
focal_class.signature: ResponseEntity<InputStreamResource> createUser(@RequestBody OadrUserCreateDto dto,
  			HttpServletResponse response)
focal_class.class_method_signature: AccountController.deleteUser(@PathVariable("username") String username, HttpServletResponse response)
focal_class.full_signature: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) @ResponseBody public void deleteUser(@PathVariable("username") String username, HttpServletResponse response)
focal_class.identifier: deleteUser
focal_class.modifiers: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) @ResponseBody public
focal_class.parameters: (@PathVariable("username") String username, HttpServletResponse response)
focal_class.return: void
focal_class.signature: void deleteUser(@PathVariable("username") String username, HttpServletResponse response)
focal_class.class_method_signature: AccountController.listApp()
focal_class.full_signature: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/app", method = RequestMethod.GET) @ResponseBody public List<OadrAppDto> listApp()
focal_class.identifier: listApp
focal_class.modifiers: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/app", method = RequestMethod.GET) @ResponseBody public
focal_class.parameters: ()
focal_class.return: List<OadrAppDto>
focal_class.signature: List<OadrAppDto> listApp()
focal_class.class_method_signature: AccountController.createApp(@RequestBody OadrAppCreateDto dto,
  			HttpServletResponse response)
focal_class.full_signature: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/app", method = RequestMethod.POST) @ResponseBody public ResponseEntity<InputStreamResource> createApp(@RequestBody OadrAppCreateDto dto,
  			HttpServletResponse response)
focal_class.identifier: createApp
focal_class.modifiers: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/app", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@RequestBody OadrAppCreateDto dto,
  			HttpServletResponse response)
focal_class.return: ResponseEntity<InputStreamResource>
focal_class.signature: ResponseEntity<InputStreamResource> createApp(@RequestBody OadrAppCreateDto dto,
  			HttpServletResponse response)
focal_class.class_method_signature: AccountController.deleteApp(@PathVariable("username") String username, HttpServletResponse response)
focal_class.full_signature: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/app/{username}", method = RequestMethod.DELETE) @ResponseBody public void deleteApp(@PathVariable("username") String username, HttpServletResponse response)
focal_class.identifier: deleteApp
focal_class.modifiers: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/app/{username}", method = RequestMethod.DELETE) @ResponseBody public
focal_class.parameters: (@PathVariable("username") String username, HttpServletResponse response)
focal_class.return: void
focal_class.signature: void deleteApp(@PathVariable("username") String username, HttpServletResponse response)
focal_method.body: @PreAuthorize("hasRole('ROLE_ADMIN')")
  	@RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE)
  	@ResponseBody
  	public void deleteUser(@PathVariable("username") String username, HttpServletResponse response) {
  		OadrUser findByUsername = oadrUserService.findByUsername(username);
  		if (findByUsername == null) {
  			LOGGER.warn("Unknown User: " + username);
  			response.setStatus(HttpStatus.NOT_FOUND_404);
  			return;
  		}
  		oadrUserService.delete(findByUsername);
  		LOGGER.info("Delete Ven: " + findByUsername.getUsername());
  	}
focal_method.class_method_signature: AccountController.deleteUser(@PathVariable("username") String username, HttpServletResponse response)
focal_method.full_signature: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) @ResponseBody public void deleteUser(@PathVariable("username") String username, HttpServletResponse response)
focal_method.identifier: deleteUser
focal_method.invocations: findByUsername warn setStatus delete info getUsername
focal_method.modifiers: @PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) @ResponseBody public
focal_method.parameters: (@PathVariable("username") String username, HttpServletResponse response)
focal_method.return: void
focal_method.signature: void deleteUser(@PathVariable("username") String username, HttpServletResponse response)