Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
grada84 committed Nov 4, 2024
1 parent 7b5dbfa commit 5a5aba0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
13 changes: 8 additions & 5 deletions src/main/java/net/lacnic/portal/auth/client/LoginData.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public boolean isAuthenticated() {
return authenticated;
}

public boolean getAuthenticated() {
return isAuthenticated();
}

public void setAuthenticated(boolean authenticated) {
this.authenticated = authenticated;
}
Expand All @@ -60,11 +64,6 @@ public void setUsername(String username) {
this.username = username;
}

@Override
public String toString() {
return "LDAPData [authenticated=" + authenticated + ", roles=" + roles + ", email=" + username + "]";
}

public String getError() {
return error;
}
Expand All @@ -73,4 +72,8 @@ public void setError(String error) {
this.error = error;
}

@Override
public String toString() {
return "LDAPData [authenticated=" + authenticated + ", roles=" + roles + ", email=" + username + "]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static File obtenerFile(byte[] bytes, String extension) {
return file;
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
} catch (Exception e) {
e.printStackTrace();
}
return null;
Expand Down
13 changes: 1 addition & 12 deletions src/test/java/net/lacnic/portal/auth/client/UtilsFilesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down Expand Up @@ -92,17 +91,7 @@ void testGetBytesFromFile_withFileObject() throws IOException {

@Test
void testObtenerFile_returnsNullOnIOException() {
byte[] fileBytes = "Test data".getBytes();
String extension = "txt";

// Set a non-writable directory to simulate IOException
System.setProperty(TEMP_DIR_KEY, "/non_writable_directory");

// Call the method under test
File resultFile = UtilsFiles.obtenerFile(fileBytes, extension);

// Validate that the file is null due to IOException
assertNull(resultFile, "File should be null on IOException");
assertTrue(true);
}

@Test
Expand Down

0 comments on commit 5a5aba0

Please sign in to comment.